CS FundamentalsHardGATE CS (PYQ pattern)

Which of the following relational-algebra identities are valid for union-compatible relations R and S? I. σ_{A=1}(R ∪ S) = σ_{A=1}(R) ∪ σ_{A=1}(S) II. π_A(R ∩ S) = π_A(R) ∩ π_A(S) III. π_A(R ∪ S) = π_A(R) ∪ π_A(S) IV. π_A(R − S) = π_A(R) − π_A(S)

  1. A. I, III and IV only
  2. B. II and IV only
  3. C. I and III only
  4. D. I, II and III only

Correct answer: C. I and III only

Selection and projection distribute over union. They do not distribute over intersection or difference: take R = {(1,x)} and S = {(1,y)}: π_A(R ∩ S) = ∅ but π_A(R) ∩ π_A(S) = {1}; π_A(R − S) = {1} but π_A(R) − π_A(S) = ∅.

More DBMS and SQL questions

Exams that ask this topic