CS FundamentalsVery hardGATE CS
Which relational-algebra equivalence is NOT valid in general?
- A. σ_p(R − S) = σ_p(R) − S (selection over difference)
- B. σ_p(R ∪ S) = σ_p(R) ∪ σ_p(S) (selection over union)
- C. π_A(R − S) = π_A(R) − π_A(S) (projection over difference)
- D. π_A(R ∪ S) = π_A(R) ∪ π_A(S) (projection over union)
Correct answer: C. π_A(R − S) = π_A(R) − π_A(S) (projection over difference)
Projection does not distribute over difference: with R = {(1, x)} and S = {(1, y)}, π_A(R − S) = {1} but π_A(R) − π_A(S) is empty. Selection does distribute over difference and union, and projection over union.
More DBMS and SQL questions
- R(A, B, C, D, E, F, G) has the functional dependencies AB -> C, C -> D, D -> A, BE -> F, F -> E, CG -> B. How many candidate keys does R…
- R(A, B, C, D, E) has the functional dependencies C → B, A → D, A → C, BE → A. How many superkeys does R have (counting every attribute set…
- R(A, B, C, D, E, F) has the functional dependencies EB → FA, EB → F, AB → C, D → AC, D → A, DF → A. After splitting right sides into…
- R(A, B, C, D, E, F) has the functional dependencies F → E, B → F, E → C, AB → F, D → E. R is decomposed into (B, D), (A, C, D, E), (A, B…
- R(A, B, C, D, E, F) has the functional dependencies DB → A, AC → D, E → D, DE → A, AB → E. What is the highest normal form of R among 1NF…
- R(A, B, C, D, E, F) has the functional dependencies A → C, D → E, AC → B, C → F, FD → A, A → D. The 3NF synthesis algorithm computes a…