Cartesian Product

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
A B
1 x
2 y
3 z
C D
4 p
5 q
6 s
7 t

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.