384 views

What is the optimized version of the relation algebra expression $\pi_{A1}(\pi_{A2}(\sigma_{F1}(\sigma_{F2}(r))))$, where $A1, A2$ are sets of attributes in $r$ with  $A1 \subset A2$ and $F1,F2$ are Boolean expressions based on the attributes in $r$?

1. $\pi_{A1}(\sigma_{(F1 \wedge F2)}(r))$
2. $\pi_{A1}(\sigma_{(F1 \vee F2)}(r))$
3. $\pi_{A2}(\sigma_{(F1 \wedge F2)}(r))$
4. $\pi_{A2}(\sigma_{(F1 \vee F2)}(r))$
edited | 384 views

(A) πA1(σ(F1∧F2)(r))

since A1 is subset of A2 will get only A1 attributes as it is in the outside, so we can remove project A2.

Two Selects with boolean expression can be combined into one select with And of two boolean expressions.

edited by