The join operation, denoted by , combines two
relations R and Q to form a new relation
S . If the attributes of R are referred to as
and those of Q as
then S has the m+n
attributes
. Tuples s of S are
formed by concatenating a tuple
with a tuple
, denoted as
. Usually there is a join
condition C that has to be
fulfilled by the tuples r and q that are concatenated to form an
s. In total, the notation for the join looks like this:
Put differently: the join is a subset of the
cartesian product
. The cartesian product of R and Q concatenates
each tuple of R with every tuple of Q. This results in a new
relation
with
tuples, with
|R| and |Q| being the
cardinalities of R and Q respectively.
The result of the join
can then be retrieved from
by selection over the join condition C. Thus
![]() |
(4) |
A typical query would be to find staff-student pairs who started in the department at the same time. These can be found by a join