CS FundamentalsVery hardProduct company interview · GATE level

A relation r(A, B, C, D) currently holds exactly these five tuples: (1, 2, 3, 4) (1, 2, 5, 6) (2, 2, 3, 4) (3, 4, 5, 4) (3, 4, 3, 6) How many of the dependencies A → B, B → C, AC → D, BD → A, CD → B and D → C are satisfied by this instance?

  1. A. 5
  2. B. 2
  3. C. 4
  4. D. 3

Correct answer: D. 3

An FD X → Y is violated when two tuples agree on X but differ on Y. A → B holds (1 → 2, 2 → 2, 3 → 4). B → C fails: B = 2 goes with C = 3 and C = 5. AC → D holds: the pairs (1,3), (1,5), (2,3), (3,5), (3,3) are all different. BD → A fails: tuples 1 and 3 share (B, D) = (2, 4) but have A = 1 and A = 2. CD → B holds: (3,4) → 2 twice, and (5,6), (5,4), (3,6) occur once each. D → C fails: D = 4 goes with C = 3 and C = 5. So A → B, AC → D and CD → B are satisfied: 3.

More DBMS and SQL questions

Exams that ask this topic