Relational Set Operators

SELECT

SELECT is an operator used to select a subset of rows (Also known as RESTRICT)

INTERSECT

INTERSECT is an operator used to yield only the rows that are common to two union-compatible tables

DIFFERENCE

DIFFERENCE is an operator used to yield all rows from one table that are not found in another union-compatible table

PRODUCT

PRODUCT is an operator used to yield all possible pairs of rows from two tables

•Also known as the Cartesian product

JOIN

JOIN allows information to be intelligently combined from two or more tables

A natural join links tables by selecting only the rows with common values in their common attribute(s)

Other forms of JOIN include the following:

  • Equijoin – links tables on the basis of an equality condition that compares specified columns of each table

  • Theta join – links tables using an inequality comparison operator

  • Inner join – only returns matched records from the tables that are being joined

  • Outer join – matched pairs are retained and unmatched values in the other table are left null

    • Left outer join: yields all of the rows in the first table, including those that do not have a matching value in the second table

    • Right outer join: yields all of the rows in the second table, including those that do not have matching values in the first table

DIVIDE

The DIVIDE operator is used to answer questions about one set of data being associated with all values of data in another set of data