Which of the following query transformations (i.e., replacing the l.h.s.…
1998
Which of the following query transformations (i.e., replacing the l.h.s. expression by the r.h.s. expression) is incorrect?
R₁ and R₂ are relations. C₁, C₂ are selection conditions and A₁, A₂ are attributes of R₁.
- A.
σ C₁ (σ C₂ R₁) → σ C₂ (σ C₁ (R₁))
- B.
σ C₁ (π A₁ R₁) → π A₁ (σ C₁ (R₁))
- C.
σ C₁ (R₁ ∪ R₂) → σ C₁ (R₁) ∪ σ C₁ (R₂)
- D.
π A₁ (σ C₁ (R₁)) → σ C₁ (π A₁ (R₁))
Attempted by 50 students.
Show answer & explanation
Correct answer: D
Selection (σ) can be pushed below projection (π) only if all attributes used in the selection condition are present in the projection.
In Option 4:
π A1 (σ C1 (R1)) → σ C1 (π A1 (R1))Here, C1 may use attributes other than A1.
After projection
π A1, those attributes are lost, soσ C1cannot be applied correctly.
A video solution is available for this question — log in and enroll to watch it.