Cartesian Product returns all the possible associations among the data of the different relations.
In the result of the Cartesian product, to differentiate the column of one relation with the column of other relation, it makes use of the fully qualified naming techniques.
For example if there are two relations R(A,B,C) and S(D,E,F) then columns of the Cartesian product result will be named as: R.A,R.B,R.C,S.D,S.E,S.F.
Note: in order to apply Cartesian product among the relations, those relations need not to be union compatible with each others.
Degree d(R×S) = d(R) + d(S).
Cardinality |R×S| = |R| * |S|
Example:
R | S | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
R×S
R.A | R.B | S.C | S.D |
---|---|---|---|
1 | x | 4 | p |
1 | x | 5 | q |
1 | x | 6 | s |
1 | x | 7 | t |
2 | y | 4 | p |
2 | y | 5 | q |
2 | y | 6 | s |
2 | y | 7 | t |
3 | z | 4 | p |
3 | z | 5 | q |
3 | z | 6 | s |
3 | z | 7 | t |
One comment