Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F=
CH→G, A→BC, B→CFH, E→A, F→EG is a set of functional dependencies (FDs) so that F+ is exactly the set of FDs that hold for R.
How many candidate keys does the relation R have?
View worked solutionShowHide
Answer: B
To find the candidate keys of relation R(A,B,C,D,E,F,G,H), we first identify the attributes that do not appear on the right-hand side (RHS) of any functional dependency in F:
D and H do not appear on the RHS of any FD. Thus, both D and H must be part of every candidate key.
Let's compute the attribute closure of the essential set {D,H}:
{D,H}+={D,H}
Since {D,H} is not a superkey, we must add other attributes to it to find the candidate keys:
Testing A:{A,D,H}+={A,D,H}A→BC{A,B,C,D,H}B→CFH{A,B,C,D,F,H}F→EG{A,B,C,D,E,F,G,H}
Thus, {A,D,H} is a candidate key.
Testing B:{B,D,H}+={B,D,H}B→CFH{B,C,F,H,D}F→EG{B,C,E,F,G,H,D}E→A{A,B,C,D,E,F,G,H}
Thus, {B,D,H} is a candidate key.
Testing E:{E,D,H}+={E,D,H}E→A{A,E,D,H}A→BC{A,B,C,E,D,H}B→CFH⋯={A,B,C,D,E,F,G,H}
Thus, {E,D,H} is a candidate key.
Testing F:{F,D,H}+={F,D,H}F→EG{E,F,G,D,H}E→A{A,E,F,G,D,H}A→BC⋯={A,B,C,D,E,F,G,H}
Thus, {F,D,H} is a candidate key.
Testing the remaining attributes C and G (e.g., {C,D,H}+ or {G,D,H}+) does not yield all attributes. Therefore, there are exactly 4 candidate keys: {A,D,H}, {B,D,H}, {E,D,H}, and {F,D,H}.
Free practice · Your answers on this page are not saved.