Database Reference
In-Depth Information
Example 5a:
We desire to have a list showing combinations of department name
and name of the related department head: Two solutions are possible. Firstly we can take
a cartesian product of
Dept
and
Staff
, followed by a selection, followed by a projection.
Secondly, we could take an equijoin, followed by a projection. The second solution is
clarified in the next sub-section (example 5b).
Please note:
1.
This example illustrates that a natural join is equivalent to
a Cartesian product followed by a selection. Proof of this
principle is not necessary for this course. However, the
principle can be easily illustrated as in Figure
7-4
.
Figure 7-4.
Illustrating That a Join is Obtained by a Cross Product Followed by a Selection