Relational Algebra Laws (cont)
Rewrite rules for projection ...
All but last projection can be ignored:
- πL1 ( πL2 ( ... πLn (R))) → πL1 (R)
Projections can be pushed into joins:
- πL (R ⋈c S) ↔ πL ( πM(R) ⋈c πN(S) )
where
- M and N must contain all attributes needed for c
- M and N must contain all attributes used in L
(L ⊂ M∪N)
Subqueries ⇒ convert to a join
|