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)
- A. I, III and IV only
- B. II and IV only
- C. I and III only
- 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
- R(A, B) has 100 tuples; R.B is a foreign key to S(B), which is S's primary key, but R.B allows NULL and 10 tuples of R have B = NULL. S…
- Three transactions each run x = x + 10 as an unprotected read followed by a write of (value read + 10), on a shared x that starts at 0…
- R(A, B, C, D, E, F) has the functional dependencies B → E, F → A, BC → F, AF → D, C → B. What is the highest normal form of R (1NF, 2NF…
- R(A, B, C, D, E) has the functional dependencies D → C, DC → B, A → B, AC → E, C → A, E → C, D → E. How many of the listed dependencies…
- R(A, B, C, D, E, F) has the functional dependencies A -> B, DB -> F, FB -> C, A -> C, A -> D, EF -> B. An attribute set X is closed if X+…
- R(A, B, C, D, E, F) has the functional dependencies AF → E, D → B, BF → D, ED → C, C → F. How many attributes belong to EVERY candidate…