CS FundamentalsHardTCS NQT · Infosys interview pattern

R(A, B, C, D) has exactly two candidate keys: A and BC. How many superkeys does R have?

  1. A. 12
  2. B. 14
  3. C. 10
  4. D. 4

Correct answer: C. 10

Superkeys containing A: 2³ = 8. Containing both B and C: 2² = 4. Containing A, B and C: 2 (counted in both). By inclusion–exclusion 8 + 4 − 2 = 10. 12 forgets to subtract the overlap, 14 adds it instead, and 4 counts only the supersets of BC.

More DBMS and SQL questions

Exams that ask this topic