b. Given the three sets A = {Kim, Tom, John}, B = {biology-major, arts-major, CS-major}, C = {$40K, $20K, $70k}, {biology-major, arts-major, CS-major}, show that the following subset is a relation of the Cartesian product A × B × C, and show the relation in tabular form. (2 points) {(Kim, CS-major, $70K), (Tom, arts-major, $20K), (John, biology-major, $40K)}
c. For the table derived in problem 6B, give the projections P({1, 3}) in a tabular form (2 points)
d. Given the relation given below for the sets in problem, 6b, which key can act as primary key and why?. Explain. {(Kim, CS-major, $70K), (Tom, CS-major, $70 K), (john, biology-major, $40K)} (2 points)
(b) We see that every element of the relation comes from the three given sets (maintaining order as well) and hence is a subset of some relation involving the 3 sets. Since these are 3-tuples, they are a subset of the relation of the direct cartesian product of the three sets.
The table looks like:
Kim | CS-major | $70k |
Tom | Arts-major | $20k |
John | Biology-major | $40k |
(c) The projection is simply the first and third columns, and hence is:
Kim | $70k |
Tom | $20k |
John | $40k |
(d) The given relation in tabular form is:
Kim | CS-major | $70k |
Tom | CS-major | $70k |
John | Biology-major | $40k |
Since the 2nd and 3rd column has duplicate elements, it cannot be used as primary key as primary key requires each element to be unique. We see that the 1st column has no duplicate elements and thus it can be used as a primary key.
Get Answers For Free
Most questions answered within 1 hours.