Consider a relation schema ๐ =(๐ด,๐ต,๐ถ,๐ท,๐ธ,๐น) on which the followingโฆ
2018
Consider a relation schemaย ๐ =(๐ด,๐ต,๐ถ,๐ท,๐ธ,๐น)ย on which the following functional dependencies hold :
๐ดโ๐ต
๐ต,๐ถโ๐ท
๐ธโ๐ถ
๐ทโ๐ด
What are the candidate keys ofย ๐ ย ?
- A.
๐ด๐ธย andย ๐ต๐ธ
- B.
๐ด๐ธ,๐ต๐ธย andย ๐ท๐ธ
- C.
๐ด๐ธ๐น,๐ต๐ธ๐นย andย ๐ต๐ถ๐น
- D.
๐ด๐ธ๐น,๐ต๐ธ๐นย andย ๐ท๐ธ๐น
Attempted by 818 students.
Show answer & explanation
Correct answer: D
Solution:
Key idea: F must be included in every candidate key because F does not appear on the right-hand side of any functional dependency, so no attribute set can determine F unless F is included.
Compute closure of AEF:
AEF+ starts with {A,E,F}. From A->B add B, from E->C add C, and then from B,C->D add D. So AEF+ = {A,B,C,D,E,F} which is all attributes.
Compute closure of BEF:
BEF+ starts with {B,E,F}. From E->C add C, from B,C->D add D, and from D->A add A. So BEF+ = {A,B,C,D,E,F}.
Compute closure of DEF:
DEF+ starts with {D,E,F}. From D->A add A, from A->B add B, and from E->C add C. So DEF+ = {A,B,C,D,E,F}.
Minimality check:
Removing F from any of these sets leaves an attribute (F) that is not produced by the FDs, so the result cannot be a key. Removing other attributes from each set also causes the closure to miss some attributes (for example, EF+ = {C,E,F} misses A and B). Therefore each of AEF, BEF, and DEF is minimal.
Answer: The candidate keys are AEF, BEF, and DEF.
A video solution is available for this question โ log in and enroll to watch it.