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ย ๐‘…ย ?

  1. A.

    ๐ด๐ธย andย ๐ต๐ธ

  2. B.

    ๐ด๐ธ,๐ต๐ธย andย ๐ท๐ธ

  3. C.

    ๐ด๐ธ๐น,๐ต๐ธ๐นย andย ๐ต๐ถ๐น

  4. 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.

  1. 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.

  2. 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}.

  3. 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}.

  4. 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.

Explore the full course: Mppsc Assistant Professor