Presentation is loading. Please wait.

Presentation is loading. Please wait.

Where are we? Until now: Modeling databases (ODL, E/R): all about the schema Now: Manipulating the data: queries, updates, SQL Then: looking inside -

Similar presentations


Presentation on theme: "Where are we? Until now: Modeling databases (ODL, E/R): all about the schema Now: Manipulating the data: queries, updates, SQL Then: looking inside -"— Presentation transcript:

1 Where are we? Until now: Modeling databases (ODL, E/R): all about the schema Now: Manipulating the data: queries, updates, SQL Then: looking inside - storage, query optimization Later: advanced features: constraints, triggers, recursion, objects

2 Relational Algebra Basic operations: Projection Selection Union
Intersection Set difference Cartesian product Join (natural join, theta join) By combining basic operations, we can express more complex queries.

3 Complex Queries Product ( name, price, category, maker)
Purchase (buyer, seller, store, product) Company (name, stock price, country) Person( name, phone number, city) Find phone numbers of people who bought gizmos from Fred. Find telephony products that somebody bought

4 Exercises Product ( name, price, category, maker)
Purchase (buyer, seller, store, product) Company (name, stock price, country) Person( name, phone number, city) Ex #1: Find people who bought telephony products. Ex #2: Find names of people who bought American products Ex #3: Find names of people who bought American products and did not buy French products Ex #4: Find names of people who bought American products and they live in Seattle. Ex #5: Find people who bought stuff from Joe or bought products from a company whose stock prices is more than $50.

5 Operations on Bags (and why we care)
Basic operations: Projection Selection Union Intersection Set difference Cartesian product Join (natural join, theta join)


Download ppt "Where are we? Until now: Modeling databases (ODL, E/R): all about the schema Now: Manipulating the data: queries, updates, SQL Then: looking inside -"

Similar presentations


Ads by Google