Presentation is loading. Please wait.

Presentation is loading. Please wait.

Set operators Union Minus Intersect match ALL COLUMNS must have same ID, column names.

Similar presentations


Presentation on theme: "Set operators Union Minus Intersect match ALL COLUMNS must have same ID, column names."— Presentation transcript:

1 Set operators Union Minus Intersect match ALL COLUMNS must have same ID, column names

2 Which is better? Filter with many conditions Union, Intersect, Minus of multiple filters Efficiency?

3 SQL Review select [columns] from table1, [table2] where condition1 and condition2 group by columns

4 SQL Review (select [columns] from table1, [table2] where condition1 and condition2 group by columns ) union (... ) alternate syntax for join

5 Practice queries Each creature who can swim but not gargle Each creature who can swim and float Each creature who has achieved two skills Do these in SQL or GRAPE (if possible)

6 Times Cartesian product of two sets this is what SQL does when you don't specify a join condition Times + Filter = Match Join GRAPE problems

7 Practice queries Each creature who can swim but not gargle Each creature with the number of skills it has achieved Do these in SQL and then GRAPE (if possible)

8 Query planner Use indices to satisfy filter conditions Hash joins Optimize join order B trees

9 Data constistency Atomicity Entire transactions complete or fail Consistency Foreign key constrains satisfied Isolation Transactions isolated from each other Durability As soon as a transaction is done, it's done start transaction / end transaction

10 Experiment with Postgres!


Download ppt "Set operators Union Minus Intersect match ALL COLUMNS must have same ID, column names."

Similar presentations


Ads by Google