3. Data Management Query Query Query D ata B ase M anagement S ystem (DBMS) Data Application
4. Example: At a Company Employee Department Query 1: Is there an employee named “Nemo”? Query 2: What is “Nemo’s” salary? Query 3: How many departments are there in the company? Query 5: What is the name of “Nemo’s” department? Query 4: How many employees have Salary >= 80K? Query 6: How many employees are there in the “ Accounts” department? … 85K 76K 79K 120K Salary … … … … … 34 Ray 52 … 89 Gill 40 … 156 Dory 20 … 12 Nemo 10 … DeptID Name ID … … … … Marketing 156 … HR 89 … Accounts 34 … IT 12 … Name ID
5. D ata B ase M anagement S ystem (DBMS) DBMS Data High-level Query Q Answer Translates Q into best execution plan for current conditions, runs plan
6. Example: Store that Sells Cars Cars Owners Owners of Honda Accords who are <= 23 years old 156 Accord Honda … … … 89 Cooper Mini 34 Camry Toyota 12 Accord Honda OwnerID Model Make 21 Dory 156 … … … 36 Gill 89 42 Ray 34 22 Nemo 12 Age Name ID Filter (Make = Honda and Model = Accord) Join (Cars.OwnerID = Owners.ID) 156 12 OwnerID 21 Dory 156 Accord Honda 22 Nemo 12 Accord Honda Age Name ID Model Make Filter (Age <= 23)
7. D ata B ase M anagement S ystem (DBMS) DBMS Data High-level Query Q Answer Translates Q into best execution plan for current conditions, runs plan Keeps data safe and correct despite failures, concurrent updates, online processing, etc.
8.
9. Final balance = $300 read balance; $400 if balance > amount then balance = balance - amount; $300 write balance; $300 read balance; $400 if balance > amount then balance = balance - amount; $350 write balance; $350 Homer withdraws $100: Marge withdraws $50:
10. Final balance = $350 read balance; $400 if balance > amount then balance = balance - amount; $300 write balance; $300 read balance; $400 if balance > amount then balance = balance - amount; $350 write balance; $350 Homer withdraws $100: Marge withdraws $50:
11.
12.
13. D ata B ase M anagement S ystem (DBMS) DBMS Data High-level Query Q Answer Translates Q into best execution plan for current conditions, runs plan Keeps data safe and correct despite failures, concurrent updates, online processing, etc.
14.
15. Modern DBMS Architecture Applications OS SQL File system API calls DBMS Disk(s) Parser Query Optimizer Query Executor Storage Manager Logical query plan Physical query plan Access method API calls Storage system API calls
16.
17. Using a Traditional DBMS User/Application Loader Table R Table S Query Result Result … Query …
18. New Approach for Data Streams User/Application Stream Query Processor Register Continuous Query (Standing Query) Input streams Result
19.
20.
21. New Challenges in DBMSs DBMS Data TeraBytes PetaBytes <CD> <TITLE>Empire B.</TITLE> <ARTIST>Bob Dylan</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>Columbia </COMPANY> <PRICE>10.90</PRICE> </CD> High-level Query Q Answer