Answer: 6 : 6
A superkey of a relation is any set of attributes that contains a candidate key as a subset.
Given the relation schema R(A,B,C,D) with the set of all attributes U={A,B,C,D}, the candidate keys are:
- K1={A,B}
- K2={A,C}
We can find the total number of superkeys using the Principle of Inclusion-Exclusion:
Total Superkeys=∣Supersets of K1∣+∣Supersets of K2∣−∣Supersets of both K1 and K2∣
- Supersets of K1={A,B}:
The remaining attributes are U∖{A,B}={C,D}.
Number of supersets =24−2=22=4.
These are: {A,B}, {A,B,C}, {A,B,D}, and {A,B,C,D}.
- Supersets of K2={A,C}:
The remaining attributes are U∖{A,C}={B,D}.
Number of supersets =24−2=22=4.
These are: {A,C}, {A,B,C}, {A,C,D}, and {A,B,C,D}.
- Supersets of both K1 and K2:
A set containing both K1 and K2 must contain K1∪K2={A,B,C}.
The remaining attribute is U∖{A,B,C}={D}.
Number of such supersets =24−3=21=2.
These are: {A,B,C} and {A,B,C,D}.
Applying the formula:
Total Superkeys=4+4−2=6
The 6 unique superkeys are:
- {A,B}
- {A,C}
- {A,B,C}
- {A,B,D}
- {A,C,D}
- {A,B,C,D}