# Relational algebra

joinJoin (relational algebra)relational logic&theta;''-joinbowtiecomplex joinsEquijoinjoin operation in relational algebrajoinsNF²
Relational algebra, first created by Edgar F. Codd while at IBM, is a family of algebras with a well-founded semantics used for modelling the data stored in relational databases, and defining queries on it.wikipedia
116 Related Articles

### SQL

Structured Query LanguageSQL databaseSQL Databases
The main application of relational algebra is providing a theoretical foundation for relational databases, particularly query languages for such databases, chief among which is SQL. Note: when implemented in SQL standard the "default projection" returns a multiset instead of a set, and the
Originally based upon relational algebra and tuple relational calculus, SQL consists of many types of statements, which may be informally classed as sublanguages, commonly: a data query language (DQL), a data definition language (DDL), a data control language (DCL), and a data manipulation language (DML).

### Selection (relational algebra)

selectionselections
Five primitive operators of Codd's algebra are the selection, the projection, the Cartesian product (also called the cross product or cross join), the set union, and the set difference. A generalized selection is a unary operation written as where is a propositional formula that consists of atoms as allowed in the normal selection and the logical operators 🇦🇩 (and), (or) and (negation).
In relational algebra, a selection (sometimes called a restriction in reference to E.F. Codd's 1970 paper and not, contrary to a popular belief, to avoid confusion with SQL's use of SELECT, since Codd's article predates the existence of SQL) is a unary operation that denotes a subset of a relation.

### Projection (relational algebra)

projectionprojectionsproject
Five primitive operators of Codd's algebra are the selection, the projection, the Cartesian product (also called the cross product or cross join), the set union, and the set difference.
In relational algebra, a projection is a unary operation written as where a_1,...,a_n is a set of attribute names.

### Relational model

relationalrelational data modelrelationships
Relational algebra received little attention outside of pure mathematics until the publication of E.F. Codd's relational model of data in 1970.
Data are operated upon by means of a relational calculus or relational algebra, these being equivalent in expressive power.

### Select (SQL)

SELECTSQL query keyword
projection is obtained by the addition of the keyword to eliminate duplicate data.
This is similar to a projection in Relational algebra, except that in the general case, the result may contain duplicate rows.

### Edgar F. Codd

E. F. CoddE.F. CoddCodd
Relational algebra received little attention outside of pure mathematics until the publication of E.F. Codd's relational model of data in 1970. Relational algebra, first created by Edgar F. Codd while at IBM, is a family of algebras with a well-founded semantics used for modelling the data stored in relational databases, and defining queries on it.
Codd's theorem, a result proven in his seminal work on the relational model, equates the expressive power of relational algebra and relational calculus (both of which, lacking recursion, are strictly less powerful than first-order logic).

### Tuple

tuplesn-tuple5-tuple
The result of such projection is defined as the set that is obtained when all tuples in R are restricted to the set.
Tuples also occur in relational algebra; when programming the semantic web with the Resource Description Framework (RDF); in linguistics; and in philosophy.

### Relation (database)

relationrelation schemarelations
For set union and set difference, the two relations involved must be union-compatible—that is, the two relations must have the same set of attributes.
A view can be defined by an expression using the operators of the relational algebra or the relational calculus.

### Aggregate function

decomposable aggregation functionaggregationsAggregate
There are five aggregate functions that are included with most relational database systems.
Aggregate functions occur commonly in numerous programming languages, in spreadsheets, and in relational algebra.

### Null (SQL)

NULL NULLs
The operators defined in this section assume the existence of a null value, ω, which we do not define, to be used for the fill values; in practice this corresponds to the NULL in SQL.
In particular a table containing any nulls is not equal with a natural self-join of itself, meaning that whereas is true for any relation R in relational algebra, a SQL self-join will exclude all rows having a Null anywhere.

### Query optimization

query optimizeroptimizationQuery processing
Our primary goal is to transform expression trees into equivalent expression trees, where the average size of the relations yielded by subexpressions in the tree is smaller than it was before the optimization.
These consist of logical optimization—which generates a sequence of relational algebra to solve the query—and physical optimization—which is used to determine the means of carrying out each operation.

### Composition of relations

compositionrelation compositionrelative product
This can also be used to define composition of relations.
Other forms of composition of relations, which apply to general n-place relations instead of binary relations, are found in the join operation of relational algebra.

### Pullback (category theory)

pullbackfiber productfibre product
In category theory, the join is precisely the fiber product.

### Relational database

relational database management systemRDBMSrelational databases
The main application of relational algebra is providing a theoretical foundation for relational databases, particularly query languages for such databases, chief among which is SQL.

### Well-founded semantics

Relational algebra, first created by Edgar F. Codd while at IBM, is a family of algebras with a well-founded semantics used for modelling the data stored in relational databases, and defining queries on it.

### Query language

querydatabase query languageData query language
The main application of relational algebra is providing a theoretical foundation for relational databases, particularly query languages for such databases, chief among which is SQL.

### Cartesian product

productCartesian squareCartesian power
Five primitive operators of Codd's algebra are the selection, the projection, the Cartesian product (also called the cross product or cross join), the set union, and the set difference. The relational algebra uses set union, set difference, and Cartesian product from set theory, but adds additional constraints to these operators.

### Union (set theory)

unionset unionunions
Five primitive operators of Codd's algebra are the selection, the projection, the Cartesian product (also called the cross product or cross join), the set union, and the set difference. The relational algebra uses set union, set difference, and Cartesian product from set theory, but adds additional constraints to these operators.

### Set theory

axiomatic set theoryset-theoreticset
The relational algebra uses set union, set difference, and Cartesian product from set theory, but adds additional constraints to these operators.

### Intersection (set theory)

intersectionintersectionsset intersection
Because set intersection is defined in terms of set union and set difference, the two relations involved in set intersection must also be union-compatible.

### Set (mathematics)

setsetsmathematical set
The result of such projection is defined as the set that is obtained when all tuples in R are restricted to the set. In addition, the Cartesian product is defined differently from the one in set theory in the sense that tuples are considered to be "shallow" for the purposes of the operation.

### Unary operation

A projection is a unary operation written as where is a set of attribute names. A generalized selection is a unary operation written as where is a propositional formula that consists of atoms as allowed in the normal selection and the logical operators 🇦🇩 (and), (or) and (negation).

### Multiset

multisetsbagbag (multiset)
Note: when implemented in SQL standard the "default projection" returns a multiset instead of a set, and the

### Propositional formula

propositionalalgebra of propositionsBoolean
A generalized selection is a unary operation written as where is a propositional formula that consists of atoms as allowed in the normal selection and the logical operators 🇦🇩 (and), (or) and (negation).

### Atomic formula

atomatomicatomic expressions
A generalized selection is a unary operation written as where is a propositional formula that consists of atoms as allowed in the normal selection and the logical operators 🇦🇩 (and), (or) and (negation).