Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exercises ReservesSailorsBoats Find names of sailors who’ve reserved boat #103 Basic operations: Selection ( σ ) gives a subset of rows. Projection ( π.

Similar presentations


Presentation on theme: "Exercises ReservesSailorsBoats Find names of sailors who’ve reserved boat #103 Basic operations: Selection ( σ ) gives a subset of rows. Projection ( π."— Presentation transcript:

1 Exercises ReservesSailorsBoats Find names of sailors who’ve reserved boat #103 Basic operations: Selection ( σ ) gives a subset of rows. Projection ( π ) Deletes unwanted cols. Cross-product (  ) combine two relations. Set-difference ( — ) Tuples in reln. 1, but not in reln. 2. Union (  ) Tuples in reln. 1 and in reln. 2. Additional operations: Intersection (  ) – Tuples in both relns. Join ( ) – like  but only keep tuples where common fields equal Division ( / ) – tuples from reln 1 with matches in reln 2 Renaming ( ρ) – Rename columns Solution 2: Solution 1:

2 Exercises ReservesSailorsBoats Basic operations: Selection ( σ ) gives a subset of rows. Projection ( π ) Deletes unwanted cols. Cross-product (  ) combine two relations. Set-difference ( — ) Tuples in reln. 1, but not in reln. 2. Union (  ) Tuples in reln. 1 and in reln. 2. Additional operations: Intersection (  ) – Tuples in both relns. Join ( ) – like  but only keep tuples where common fields equal Division ( / ) – tuples from reln 1 with matches in reln 2 Renaming ( ρ) – Rename columns Find names of sailors who’ve reserved a red boat v A more efficient solution:

3 Exercises ReservesSailorsBoats Basic operations: Selection ( σ ) gives a subset of rows. Projection ( π ) Deletes unwanted cols. Cross-product (  ) combine two relations. Set-difference ( — ) Tuples in reln. 1, but not in reln. 2. Union (  ) Tuples in reln. 1 and in reln. 2. Additional operations: Intersection (  ) – Tuples in both relns. Join ( ) – like  but only keep tuples where common fields equal Division ( / ) – tuples from reln 1 with matches in reln 2 Renaming ( ρ) – Rename columns Find sailors who’ve reserved a red or a green boat

4 Exercises ReservesSailorsBoats Basic operations: Selection ( σ ) gives a subset of rows. Projection ( π ) Deletes unwanted cols. Cross-product (  ) combine two relations. Set-difference ( — ) Tuples in reln. 1, but not in reln. 2. Union (  ) Tuples in reln. 1 and in reln. 2. Additional operations: Intersection (  ) – Tuples in both relns. Join ( ) – like  but only keep tuples where common fields equal Division ( / ) – tuples from reln 1 with matches in reln 2 Renaming ( ρ) – Rename columns Find sailors who’ve reserved a red and a green boat

5 Exercises ReservesSailorsBoats Basic operations: Selection ( σ ) gives a subset of rows. Projection ( π ) Deletes unwanted cols. Cross-product (  ) combine two relations. Set-difference ( — ) Tuples in reln. 1, but not in reln. 2. Union (  ) Tuples in reln. 1 and in reln. 2. Additional operations: Intersection (  ) – Tuples in both relns. Join ( ) – like  but only keep tuples where common fields equal Division ( / ) – tuples from reln 1 with matches in reln 2 Renaming ( ρ) – Rename columns Find the names of sailors who’ve reserved all boats


Download ppt "Exercises ReservesSailorsBoats Find names of sailors who’ve reserved boat #103 Basic operations: Selection ( σ ) gives a subset of rows. Projection ( π."

Similar presentations


Ads by Google