Professional Documents
Culture Documents
Systems
Shivnath Babu
Fall 2006
Application
Data Management
Query
Query
Query
Data
Example: At a Company
Query 1: Is there an employee named Nemo?
Query 2: What is Nemos salary?
Query 3: How many departments are there in the company?
Query 4: How many employees have Salary >= 80K?
Query 5: What is the name of Nemos department?
Query 6: How many employees are there in the
Accounts department?
Employee
Department
ID
Name
DeptID
Salary
ID
Name
10
Nemo
12
120K
12
IT
20
Dory
156
79K
34
Accounts
40
Gill
89
76K
89
HR
52
Ray
34
85K
156
Marketing
Answer
DBMS
Data
Translates Q into
best execution plan
for current conditions,
runs plan
Cars
Age
22
21
Owners
Make
Model
OwnerID
ID
Name
Age
Honda
Accord
12
12
Nemo
22
Toyota
Camry
34
34
Ray
42
Mini
Cooper
89
89
Gill
36
Honda
Accord
156
156
Dory
21
Answer
DBMS
Keeps data safe
and correct
despite failures,
concurrent
updates, online
processing, etc.
Data
Translates Q into
best execution plan
for current conditions,
runs plan
DBMS is multi-user
Example
Get account balance from database;
If balance > amount of withdrawal then
balance = balance - amount of withdrawal;
dispense cash;
store new balance into database;
Recovery in DBMS
Example: balance transfer
decrement the balance of account X
by $100;
increment the balance of account Y
by $100;
Scenario 1: Power goes out after the first
instruction
Scenario 2: DBMS buffers and updates data in
memory (for efficiency); before they are written
back to disk, power goes out
Log updates; undo/redo during recovery
Answer
DBMS
Keeps data safe
and correct
despite failures,
concurrent
updates, online
processing, etc.
Data
Translates Q into
best execution plan
for current conditions,
runs plan
Parser
Logical query plan
Query Optimizer
Physical query plan
Query Executor
Access method API calls
Storage Manager
Course Outline
50% of the class is about core DBMS concepts
Query execution, query optimization, transactions,
recovery, etc.
Textbook material
Data streams
Web search Google, Yahoo!
XML and data integration
Data mining
Sensor data management
Loader
Result
Result
Table R
Table S
Input streams
Result
Stream Query
Processor
Course Outline
50% of the class is about core DBMS concepts
Query execution, query optimization, transactions,
recovery, etc.
Textbook material
Data streams
Web search Google, Yahoo!
XML and data integration
Data mining
Sensor data management
Answer
DBMS
TeraBytes PetaBytes
Data
<CD>
<TITLE>Empire B.</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia
</COMPANY>
<PRICE>10.90</PRICE>
</CD>
Course Logistics
Recommended reference: Database Systems: The
Complete Book, by H. Garcia-Molina, J. D. Ullman,
and J. Widom
Web site: http://www.cs.duke.edu/education/courses/fall06/cps216
Grading:
Homework Assignments 15%
Project 25%
Midterm 25%
Final 35%