CS FundamentalsModerateGATE CS · PSU (ISRO/BARC)

R(A, B) = {(1, 3), (3, 2), (3, 4), (4, 2)} and S(B, C) = {(2, 5), (2, 7), (3, 6), (3, 7), (4, 5)}. How many tuples does σ_{R.B ≠ S.B}(R × S) have?

  1. A. 20
  2. B. 7
  3. C. 14
  4. D. 13

Correct answer: D. 13

R × S has 4 × 5 = 20 tuples; 7 of them have R.B = S.B (exactly the natural-join pairs), so 13 remain.

More DBMS and SQL questions

Exams that ask this topic