Database Reference

In-Depth Information

4.14.3 Product

Joins are based on the relational operator product, a direct analogue of an operator in set

theory known as the
Cartesian product
. It is denoted by a symbol cross (x). Product takes

two relations as input and produces as output one relation composed of all the possible

combinations of input tuples/rows. Product is a little-used operator in practice because of

its potential for generating an 'information explosion'.

Syntax of the product operator is given below:

PRODUCT <table 1> WITH <table 2><result table>

Example13:

PRODUCT Teacher WITH Subject R

In the following figure we have two relation Teacher and Subject.

The output of this product have all combination of tuples/rows of both relations/ tables. We

get a relation of six tuples with six attributes.