Presentation is loading. Please wait.

Presentation is loading. Please wait.

Algebraic Laws. 16.2.1 Commutative and Associative Laws Commutativity for Sets and Bags (Ch5): R x S = S x R (Proof) R  S = S  R (ch5 e) R U S = S U.

Similar presentations


Presentation on theme: "Algebraic Laws. 16.2.1 Commutative and Associative Laws Commutativity for Sets and Bags (Ch5): R x S = S x R (Proof) R  S = S  R (ch5 e) R U S = S U."— Presentation transcript:

1 Algebraic Laws

2 16.2.1 Commutative and Associative Laws Commutativity for Sets and Bags (Ch5): R x S = S x R (Proof) R  S = S  R (ch5 e) R U S = S U R(ch5) R ∩ S = S ∩ R (ch5) Associativity Sets and Bags: : (R x S) x T = R x (S x T)‏ (R  S)  T = R  (S  T)‏ (R U S) U T = R U (S U T)‏ (ch5) (R ∩ S) ∩ T = R ∩ (S ∩ T)‏ (ch5)

3 16.2.2 Laws Involving Selection For a union, the selection must be pushed to both arguments. σ c (R U S) = σ c (R) U σ c (S) For a difference, the selection must be pushed to first argument and optionally to second. σ c (R - S) = σ c (R) – S σ c (R - S) = σ c (R) - σ c (S) It is only required that the selection must be pushed to one or both argument. –σ c (R x S) = σ c (R) x S –σ c (R  S) = σ (R)  S –σ c (R  D S) = σ (R)  D S –σ c ( R ∩ S) = σ c (R) ∩ S

4 16.2.2 Laws Involving Selection it is only required that the selection must be pushed to one or both argument. –σ c (R x S) = R x σ c (S) –σ c (R  S) = σ c (R)  σ c (S)

5 16.2.4. Laws involving Projection Consider term π E  x –E : attribute, or expression involving attributes and constants. –All attributes in E are input attributes of projection and x is output attribute Simple projection: if a projection consists of only attributes. –Example: π a,b,c (R) is simple. a,b,c are input and output attributes. Projection can be introduced anywhere in expression tree as long as it only eliminates attributes that are never used.

6 16.2.4. Laws involving Projection (cont….) π L (R S) = π L ( π M (R) π N (S)) ; M and N are all attributes of R and S that are either join (in schema of both R and S) or input attributes of L π L (R c S) = π L ( π M (R) c π N (S)) ; M and N are all attributes of R and S that are either join(mentioned in condition of C ) or input attributes of L π L (R x S) = π L ( π M (R) x π N (S)) ; M and N are all attributes of R and S that are input attributes of L Projections cannot be pushed below set unions or either of set or bag versions of intersection or difference at all.


Download ppt "Algebraic Laws. 16.2.1 Commutative and Associative Laws Commutativity for Sets and Bags (Ch5): R x S = S x R (Proof) R  S = S  R (ch5 e) R U S = S U."

Similar presentations


Ads by Google