Candidate Key
Candidate Key
Candidate Key is a Super Key whose no proper subset is a super key, i.e.
suppose if ABC is a candidate key then neither A, B, C or any of its
combination can be super key, hence we can say candidate key is a minimal
set of attributes of an R( Relational Schema) which can be used to identify a
tuple of a table uniquely.
OR
The nominee of Primary Key is a candidate key, for example, Mobile No.,
Aadhar No., Roll No. all can act as the nominee of Primary key, hence they all
are candidate key.
Since XYZ closure is determining all the attributes of the table, hence it
is Super Key
Step 2: Let us calculate the closure of XY+ = XYZW (from the method we
studied earlier)
Since X closure is determining all the attributes of the table, hence it is Super
Key
As we have talked in the above step only for the super key, not for the
candidate key.
Let us see the definition of Candidate Key again (Candidate Key is a Super
Key whose no proper subset is a superkey)
From the above definition, XYZ is not a candidate key, as in Step 2 and 3
we found that XY and X are also Super Key (i.e., subset of XYZ are also SK
which violate the definition)
Hence XYZ, XY, and X are all Super Key, while the only X is a candidate
key
Since Z closure is determining all the attributes of the table, hence it is Super
Key
Since X closure is not determining all the attributes of the table, hence it
is Not Super Key, since it is not SK it can never be Candidate key
As we have talked in the above step only for the super key, not for the
candidate key.
Let us see the definition of Candidate Key again (Candidate Key is a Super
Key whose no proper subset is a superkey)
Hence XY and Z are Super Key, also XY and Z are a candidate key
Example 2: Given R( X Y Z W) and FD= { Y → XZW, XZW
→Y}
Step 1: Let us calculate the closure of Y+ = XYZW (from the method we
studied earlier)
Since Y closure is determining all the attributes of the table, hence it is Super
Key
Step 2: Let us calculate the closure of XZW+ = XZWY (from the method we
studied earlier)
Since a closure is determining all the attributes of the table, hence it is Super
Key
As we have talked in the above step only for the super key, not for the
candidate key.
Let us see the definition of Candidate Key again (Candidate Key is a Super
Key whose no proper subset is a superkey)
Hence Y and XZW are Super Key, also Y, and XZW are also a candidate
key.
From the definition of Candidate Key (Candidate Key is a Super Key whose
no proper subset is a Super key)
We can say that any further combination of WX, WY, WZ, i.e. WXY, WXYZ,
WYZ, WZX will be Super Key but not a candidate key.
ADVERTISEMENT
Since the closure of Y contains the only Y, hence it is not a candidate key.
From the definition of Candidate Key (Candidate Key is a Super Key whose
no proper subset is a Super key)
We can say that any further combination of Y X, Y W, will be Super Key but
not a candidate key.
We can say that any further combination of QU, i.e. QUP, QUR, QUS, QUT,
etc.
Hence for such type of questions, we first check the closure of all attributes
individually, then their combination by keeping in mind the definition of
Candidate Key.
Since from above none of the above are candidate key, hence we try the
combination of A, B, C, and D i.e. ( AB, AC, AD, BC, BD, CD)
Let us calculate closure of AB, AC, AD, BC, BD, CD using FD = { AB → CD, C
→ A, D → B}
Since AC and BD are the two combinations which do not form candidate key,
therefore let us try their combinations, by keeping in mind that any proper
subset of that combination should not be candidate key, as per the definition
of a candidate key.