Consider a relation scheme R = (A, B, C, D, E, H) on which the following…

2005

Consider a relation scheme R = (A, B, C, D, E, H) on which the following functional dependencies hold: {A → B, BC → D, E → C, D → A}. What are the candidate keys of R?

  1. A.

    AE, BE

  2. B.

    AE, BE, DE

  3. C.

    AEH, BEH, BCH

  4. D.

    AEH, BEH, DEH

Attempted by 144 students.

Show answer & explanation

Correct answer: D

Step 1: Identify attributes that do not appear on the right-hand side of any functional dependency. These must be part of every candidate key. In this relation, E and H do not appear on the right-hand side.

Step 2: Compute the closure of {E, H}. Using E → C gives us {C, E, H}. We still need A, B, and D.

Step 3: Add attributes to {E, H} to form candidate keys. Testing {A, E, H}: A → B and E → C allows us to derive D via BC → D. Closure is {A, B, C, D, E, H}. Testing {B, E, H}: E → C allows BC → D and D → A. Closure is {A, B, C, D, E, H}. Testing {D, E, H}: D → A and A → B allows us to get C via E. Closure is {A, B, C, D, E, H}.

Step 4: The candidate keys are AEH, BEH, and DEH.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir