CS FundamentalsHardGATE CS · PSU (ISRO/BARC)

R(A, B) = {(1, 1), (1, 3), (3, 1), (3, 2), (3, 3)} and S(B, C) = {(1, 5), (2, 5), (2, 6), (2, 7), (4, 6)}. How many tuples are in π_A(R ⋈ S) and in R ⋈ S respectively (set semantics)?

  1. A. 2 and 25
  2. B. 2 and 6
  3. C. 2 and 5
  4. D. 5 and 5

Correct answer: C. 2 and 5

R ⋈ S pairs each R tuple with every S tuple having the same B: 5 tuples. Projecting on A removes duplicates, leaving {1, 3}.

More DBMS and SQL questions

Exams that ask this topic