GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 2.19

Moving selections across projections

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 1998 paper

GATE 1998, Q2.19 2 marks · MCQ
Report issue

Relational Algebra & Calculus

Question 2.19, GATE 1998: Which rewrite is not generally valid? A commuting selections; B moving a well-defined selection before projection; C distributing selection over union; D moving selection after projection without retaining predicate attributes.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Selections commute because both predicates must hold, and selection distributes over union tuple by tuple. If selection after projection is already well typed, all predicate attributes survived, so pushing it down is safe. In the reverse direction, projecting first may delete an attribute needed by the predicate. For R(A, B), πA(σB=1(R)) is defined, but σB=1(πA(R)) is not. Thus D is not an unrestricted rule. Enlarged the paper B shows its right outer operator as σ with attribute subscript A 1 rather than a projection π, another literal typing defect; the coherent projection rule analyzed above is an explicitly stated reconstruction, not a silent transcription.

Original paper, page 5