Which of the following query transformations, obtained by replacing the…

1998

Which of the following query transformations, obtained by replacing the left-hand side expression by the right-hand side expression, is incorrect?

R₁ and R₂ are relations. C₁ and C₂ are selection conditions, and A₁ is an attribute set 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₁))

Answer: D. dOptions a and c use standard equivalence rules: selections commute with each other, and selection distributes over union. For option b, the left-hand side…

  1. A.

    a

  2. B.

    b

  3. C.

    c

  4. D.

    d

Attempted by 26 students.

Show answer & explanation

Correct answer: D

Options a and c use standard equivalence rules: selections commute with each other, and selection distributes over union.

For option b, the left-hand side applies σ_{C₁} after π_{A₁}. If this expression is valid, then C₁ uses only attributes present in A₁, so pushing σ_{C₁} below the projection is safe.

Option d is not generally valid. In π_{A₁}(σ_{C₁}(R₁)), the selection is applied before projection, so C₁ may use attributes that are later discarded. The right-hand side σ_{C₁}(π_{A₁}(R₁)) applies the selection after projection, where those attributes may no longer exist.

Therefore, transformation d is incorrect.

Explore the full course: Ssc Je Imd Scientific Assistant Computer Science

Loading lesson…