What is the optimized version of the relation algebra expression πA1(πA2( σF1(σ F2(r)))), where F1, F2 are sets of attributes in r with F1 ⊂ F2 and F1, F2 are Boolean expressions based on the attributes in r?

What is the optimized version of the relation algebra expression πA1(πA2( σF1(σ F2(r)))), where F1, F2 are sets of attributes in r with F1 ⊂ F2 and F1, F2 are Boolean expressions based on the attributes in r? Correct Answer π<sub><span style="position: relative; line-height: 0; vertical-align: baseline; bottom: -0.25em;">A1</span></sub>(σ<sub><span style="position: relative; line-height: 0; vertical-align: baseline; bottom: -0.25em;">(F1 </span><span style="position: relative; line-height: 0; vertical-align: baseline; bottom: -0.25em;">⋀ F2)</span></sub>(r))

Option 1: πA1(F1 ⋀ F2)(r))

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

∴ (σF1F2(r)))) ≡ (σ(F1 ⋀ F2)(r))

Since A1 is a subset of A2, therefore, the attributes of A2 will be removed and therefore we can say that.

πA1A2(X) ≡ πA1(X)

Therefore option 1 is correct.

Related Questions

Which of the following is valid for Boolean algebra but NOT for ordinary algebra?