GATE / CS ARCHIVE

GATE CSE 2014 SET 3 / QUESTION 21

GATE CSE 2014 Set 3 Q21

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2014 Set 3 paper

GATE 2014 Set 3, Q21 1 mark · MCQ
Report issue

Relational Algebra & Calculus

Question 21, GATE 2014: Simplify π_A1(π_A2(σ_F1(σ_F2(r)))), where A1⊂A2 are attribute sets of r and F1,F2 are predicates on r. A π_A1(σ_(F1∧F2)(r)); B π_A1(σ_(F1∨F2)(r)); C π_A2(σ_(F1∧F2)(r)); D π_A2(σ_(F1∨F2)(r)).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step 1: A row survives the two selections only if it satisfies both predicates, so σ_F1(σ_F2(r))=σ_(F1∧F2)(r). An OR would admit rows discarded by one selection. Step 2: Projecting onto A2 and then its subset A1 is equivalent to projecting directly onto A1, because the intermediate projection retains every finally requested attribute. Step 3: Combining these rules gives π_A1(σ_(F1∧F2)(r)), A. Keep the final output attributes A1; replacing them with A2 changes the query.

Original paper, page 57 · Answer key