CS FundamentalsVery hardGATE CS (PYQ pattern)

R(A, B, C, D, E, F, G) has the functional dependencies AB -> C, C -> D, D -> A, BE -> F, F -> E, CG -> B. How many candidate keys does R have?

  1. A. 4
  2. B. 2
  3. C. 8
  4. D. 6

Correct answer: D. 6

G appears on no right side, so it is in every key. The cycles C -> D -> A (with AB -> C) and E <-> F (via BE -> F, F -> E) let attributes substitute for each other: keys are CEG, CFG (C and G give D, A and B), and ABEG, ABFG, BDEG, BDFG (B with A or D regains C). That is 6 minimal keys; missing the D -> A substitution leaves 4.

More DBMS and SQL questions

Exams that ask this topic