CS FundamentalsEasyGATE CS (PYQ pattern)

A relation R(A, B, C) holds the tuples (1,x,10), (1,y,20), (2,x,20), (2,z,30), (3,y,10). It is decomposed into R1 = π(A,B) R and R2 = π(B,C) R. How many spurious tuples (tuples not in R) appear in the natural join R1 ⋈ R2?

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

Correct answer: D. 4

R1 has the pairs [(1, 'x'), (1, 'y'), (2, 'x'), (2, 'z'), (3, 'y')], R2 has [('x', 10), ('x', 20), ('y', 10), ('y', 20), ('z', 30)]. The join has 9 tuples, of which 5 are original, so 4 are spurious (B does not determine A or C).

More DBMS and SQL questions

Exams that ask this topic