GATE 2014 CS (CS3) – Question 31
Optimize $\pi_{A_1}(\pi_{A_2}(\sigma_{F_1}(\sigma_{F_2}(r))))$, where $A_1\subset A_2$ are attribute sets of r and $F_1,F_2$ are Boolean expressions on its attributes.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) $\pi_{A_1}(\sigma_{F_1\land F_2}(r))$
Explanation
Consecutive selections require both predicates, so combine them with F1∧F2. Since A1⊂A2, projecting ontoA2thenA1is equivalent to projecting directly ontoA1. The result is **π_A1(σ_(F1∧F2)(r)),A**. Disjunction would admit additional rows.