1. Relational Model & Algebra Zachary G. Ives University of Pennsylvania CIS 550 – Database & Information Systems November 9, 2011 Some slide content courtesy of Susan Davidson & Raghu Ramakrishnan
2.
3.
4.
5.
6. Conceptual Design for CIS Student Course Survey STUDENT COURSE Takes name sid cid name PROFESSOR Teaches semester fid name exp-grade “ Who’s taking what, and what grade do they expect?” This design is independent of the final form of the report!
14. Example Data Instance STUDENT Takes COURSE PROFESSOR Teaches sid name 1 Jill 2 Qun 3 Nitin fid name 1 Ives 2 Taskar 8 Martin sid exp-grade cid 1 A 550-0109 1 A 520-1009 3 C 501-0109 cid subj sem 550-0109 DB F09 520-1009 AI S09 501-0109 Arch F09 fid cid 1 550-0109 2 700-1009 8 501-0109
15.
16.
17.
18. Data Instance for Operator Examples STUDENT Takes COURSE PROFESSOR Teaches sid name 1 Jill 2 Qun 3 Nitin 4 Marty fid name 1 Ives 2 Taskar 8 Martin sid exp-grade cid 1 A 550-0109 1 A 520-1009 3 A 520-1009 3 C 501-0109 4 C 501-0109 cid subj sem 550-0109 DB F09 520-1009 AI S09 501-0109 Arch F09 fid cid 1 550-0109 2 520-1009 8 501-0109
31. The Big Picture: SQL to Algebra to Query Plan to Web Page SELECT * FROM STUDENT, Takes, COURSE WHERE STUDENT.sid = Takes.sID AND Takes.cID = cid Optimizer Execution Engine Storage Subsystem Web Server / UI / etc Query Plan – an operator tree STUDENT Takes COURSE Merge Hash by cid by cid