CS FundamentalsModerateGATE CS · Product placement

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

  1. A. 20
  2. B. 16
  3. C. 15
  4. D. 5

Correct answer: C. 15

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

More DBMS and SQL questions

Exams that ask this topic