* more on some of the set-theoretic operations
for relations
union
intersection
difference
* all of these view the relations as a SET of
rows/tuples
* all of these require that the relations involved
be UNION-COMPATIBLE
* the operand relations have the SAME number
of columns/attributes,
and those attributes have
(ideally) the same respective domains
(or type-compatible according the DBMS in "syntax" terms)
* union -
A u B
result is a new relation containing all of the
rows from A and all of the rows from B
* intersection -
A n B
result is a new relation containing just those
rows that are in A AND ALSO are in B
* difference
A - B
result is a new relation containing just those
rows that are in A BUT NOT also in B
* how do we express these in SQL?
(subselect)
union
(subselect)
[order by...]
(subselect)
intersect
(subselect)
[order by...]
(subselect)
minus
(subselect)
[order by...]