Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Relational algebra
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Theory of relational databases}} {{Distinguish|Relation algebra}} In [[database theory]], '''relational algebra''' is a theory that uses [[algebraic structure]]s for modeling data and defining queries on it with well founded [[semantics (computer science)|semantics]]. The theory was introduced by [[Edgar F. Codd]].<ref name="Codd1970">{{cite journal|first=E.F.|last=Codd|author-link=E.F. Codd|title=A Relational Model of Data for Large Shared Data Banks|journal=[[Communications of the ACM]]|volume=13|issue=6|date=1970|pages=377β387| doi = 10.1145/362384.362685|s2cid=207549016 |doi-access=free}}</ref> The main application of relational algebra is to provide a theoretical foundation for [[relational database]]s, particularly [[query language]]s for such databases, chief among which is [[SQL]]. Relational databases store tabular data represented as [[relation (database)|relations]]. Queries over relational databases often likewise return tabular data represented as relations. The main purpose of relational algebra is to define [[Operator (mathematics)|operators]] that transform one or more input relations to an output relation. Given that these operators accept relations as input and produce relations as output, they can be combined and used to express complex queries that transform multiple input relations (whose data are stored in the database) into a single output relation (the query results). [[Unary operator]]s accept a single relation as input. Examples include operators to filter certain attributes (columns) or [[tuple]]s (rows) from an input relation. [[Binary operator]]s accept two relations as input and combine them into a single output relation. For example, taking all tuples found in either relation ([[Union (set theory)|union]]), removing tuples from the first relation found in the second relation ([[Difference (set theory)|difference]]), extending the tuples of the first relation with tuples in the second relation matching certain conditions, and so forth.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)