CS FundamentalsVery hardGATE CS (PYQ pattern)

Relation R(A, B) has 6 tuples with 4 distinct values of A and 5 distinct values of B. What are the minimum and maximum possible cardinalities of π_A(R) ∪ π_B(R) when A and B draw from the same domain (the union is of the two single-column projections)?

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

Correct answer: A. 5 and 9

π_A has 4 values and π_B has 5, so the union has at least 5 (A-values inside the B-values) and at most 4 + 5 = 9 (disjoint).

More DBMS and SQL questions

Exams that ask this topic