SlideShare ist ein Scribd-Unternehmen logo
1 von 33
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
Recall Our Initial Discussion… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Relational Data Model (1970) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why Did It Take So Many Years to Implement Relational Databases? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Getting More Concrete: Building a Database and Application ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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!
Example Schema ,[object Object],[object Object],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 500-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
Some Terminology ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Describing Relations ,[object Object],[object Object],[object Object],STUDENT (sid:int, name:string) Takes (sid:int, exp-grade:char[2], cid:string) COURSE (cid:string, subj:string, sem:char[3]) Teaches (fid:int, cid:string) PROFESSOR (fid:int, name:string)
More on Attribute Domains ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Integrity Constraints ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SQL: Structured Query Language ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Table Definition: SQL-92 DDL and Constraints CREATE TABLE Takes (sid INTEGER, exp-grade CHAR(2), cid STRING(8), PRIMARY KEY (sid, cid), FOREIGN KEY (sid)   REFERENCES STUDENT, FOREIGN KEY (cid)   REFERENCES COURSE ) CREATE TABLE STUDENT  (sid INTEGER, name CHAR(20), )
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
From Tables    SQL    Web Application ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],C -> machine code sequence -> microprocessor Java -> bytecode sequence -> JVM SQL ->  relational algebra  expression -> query execution engine
Codd’s Relational Algebra ,[object Object],[object Object],[object Object]
Codd’s Logical Operations:  The Relational Algebra ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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
Projection,   
Selection,   
Product  X
Join,  ⋈  : A Combination of Product and Selection
Union  
Difference  –
Rename,      ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Mini-Quiz ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Deriving Intersection ,[object Object],A-B  B-A A  B A  Å  B ≡   (A  [  B) – (A – B) – (B – A) ≡  (A – B) – (B – A)
Division ,[object Object],[object Object],[object Object]
Division:  R 1     R 2 ,[object Object],[object Object],[object Object],[object Object], fid  (  fid,subj ( Teaches  ⋈  COURSE)      subj (COURSE))
Division Using Our Existing Operators ,[object Object],[object Object],[object Object], fid,subj  (PROFESSOR  £    subj (COURSE)) Allpairs -   fid,subj (Teaches ⋈ COURSE)  fid (PROFESSOR) -   fid (NotTaught) ´   fid (PROFESSOR) -   fid (  fid,subj  (PROFESSOR  £    subj (COURSE)) -  fid,subj (Teaches ⋈ COURSE))
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
Hint of Future Things:  Optimization Is Based on Algebraic Equivalences ,[object Object],[object Object], c  Ç  d (R)  ´    c (R)  [    d (R)  c  (R 1   £  R 2 )  ´  R 1  ⋈ c  R 2  c  Ç  d  (R)  ´   c  (  d  (R)) ,[object Object]
Next Time:  An Equivalent, But Very Different, Formalism ,[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Oop in c++ lecture 1
Oop in c++  lecture 1Oop in c++  lecture 1
Oop in c++ lecture 1zk75977
 
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...Raj vardhan
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
3. Relational Models in DBMS
3. Relational Models in DBMS3. Relational Models in DBMS
3. Relational Models in DBMSkoolkampus
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 
Module 5 oodb systems semantic db systems
Module 5 oodb systems  semantic db systemsModule 5 oodb systems  semantic db systems
Module 5 oodb systems semantic db systemsTaher Barodawala
 
Object oriented architecture in erp
Object  oriented architecture in erpObject  oriented architecture in erp
Object oriented architecture in erpPreyanshu Saini
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTnikshaikh786
 
Object Oriented Software Development revision slide
Object Oriented Software Development revision slide Object Oriented Software Development revision slide
Object Oriented Software Development revision slide fauza jali
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship ModellingBhandari Nawaraj
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Sakthi Durai
 
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database ConstraintsThe Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraintssontumax
 
4 the relational data model and relational database constraints
4 the relational data model and relational database constraints4 the relational data model and relational database constraints
4 the relational data model and relational database constraintsKumar
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mappingsaurabhshertukde
 

Was ist angesagt? (20)

Oop in c++ lecture 1
Oop in c++  lecture 1Oop in c++  lecture 1
Oop in c++ lecture 1
 
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
3. Relational Models in DBMS
3. Relational Models in DBMS3. Relational Models in DBMS
3. Relational Models in DBMS
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Module 5 oodb systems semantic db systems
Module 5 oodb systems  semantic db systemsModule 5 oodb systems  semantic db systems
Module 5 oodb systems semantic db systems
 
Object oriented architecture in erp
Object  oriented architecture in erpObject  oriented architecture in erp
Object oriented architecture in erp
 
Structures
StructuresStructures
Structures
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
 
Object Oriented Software Development revision slide
Object Oriented Software Development revision slide Object Oriented Software Development revision slide
Object Oriented Software Development revision slide
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
 
Object oriented database
Object oriented databaseObject oriented database
Object oriented database
 
Relational Model
Relational ModelRelational Model
Relational Model
 
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database ConstraintsThe Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraints
 
Er Modeling
Er ModelingEr Modeling
Er Modeling
 
4 the relational data model and relational database constraints
4 the relational data model and relational database constraints4 the relational data model and relational database constraints
4 the relational data model and relational database constraints
 
[OOP - Lec 02] Why do we need OOP
[OOP - Lec 02] Why do we need OOP[OOP - Lec 02] Why do we need OOP
[OOP - Lec 02] Why do we need OOP
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 
Introduction to odbms
Introduction to odbmsIntroduction to odbms
Introduction to odbms
 

Ähnlich wie 2 rel-algebra

Ch 12 O O D B Dvlpt
Ch 12  O O  D B  DvlptCh 12  O O  D B  Dvlpt
Ch 12 O O D B Dvlptguest8fdbdd
 
01 Persistence And Orm
01 Persistence And Orm01 Persistence And Orm
01 Persistence And OrmRanjan Kumar
 
Adv DB - Full Handout.pdf
Adv DB - Full Handout.pdfAdv DB - Full Handout.pdf
Adv DB - Full Handout.pdf3BRBoruMedia
 
Project Lambda: To Multicore and Beyond
Project Lambda: To Multicore and BeyondProject Lambda: To Multicore and Beyond
Project Lambda: To Multicore and BeyondDmitry Buzdin
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbmsAnjaan Gajendra
 
Intro to Relational Model
Intro to Relational ModelIntro to Relational Model
Intro to Relational ModelHazemWaheeb1
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database Rc Os
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9google
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The EnterpriseDaniel Egan
 
Third AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docxThird AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docxrandymartin91030
 

Ähnlich wie 2 rel-algebra (20)

Ch 12 O O D B Dvlpt
Ch 12  O O  D B  DvlptCh 12  O O  D B  Dvlpt
Ch 12 O O D B Dvlpt
 
oodb.ppt
oodb.pptoodb.ppt
oodb.ppt
 
01 Persistence And Orm
01 Persistence And Orm01 Persistence And Orm
01 Persistence And Orm
 
Presentation
PresentationPresentation
Presentation
 
Adv DB - Full Handout.pdf
Adv DB - Full Handout.pdfAdv DB - Full Handout.pdf
Adv DB - Full Handout.pdf
 
Unit03 dbms
Unit03 dbmsUnit03 dbms
Unit03 dbms
 
Unit03 dbms
Unit03 dbmsUnit03 dbms
Unit03 dbms
 
Project Lambda: To Multicore and Beyond
Project Lambda: To Multicore and BeyondProject Lambda: To Multicore and Beyond
Project Lambda: To Multicore and Beyond
 
Bt0066 dbms
Bt0066 dbmsBt0066 dbms
Bt0066 dbms
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbms
 
Cs501 intro
Cs501 introCs501 intro
Cs501 intro
 
Intro to Relational Model
Intro to Relational ModelIntro to Relational Model
Intro to Relational Model
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database
 
uniT 4 (1).pptx
uniT 4 (1).pptxuniT 4 (1).pptx
uniT 4 (1).pptx
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
 
Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
 
Intro
IntroIntro
Intro
 
Third AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docxThird AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docx
 

Kürzlich hochgeladen

Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxTusharBahuguna2
 
Case Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, PuneCase Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, PuneLukeKholes
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxjanettecruzeiro1
 
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Call Girls in Nagpur High Profile
 
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779Delhi Call girls
 
Tapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the FunnelTapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the Funneljen_giacalone
 
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...ranjana rawat
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentationamedia6
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...home
 
Stark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxStark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxjeswinjees
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...Call Girls in Nagpur High Profile
 
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️Call Girls in Kalkaji Delhi 8264348440 call girls ❤️
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️soniya singh
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...BarusRa
 
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130Suhani Kapoor
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130Suhani Kapoor
 
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...Call Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja Nehwal
 

Kürzlich hochgeladen (20)

Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptx
 
Case Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, PuneCase Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, Pune
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptx
 
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
 
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
 
Tapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the FunnelTapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the Funnel
 
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentation
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
Stark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxStark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptx
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
 
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️Call Girls in Kalkaji Delhi 8264348440 call girls ❤️
Call Girls in Kalkaji Delhi 8264348440 call girls ❤️
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
 
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
 
B. Smith. (Architectural Portfolio.).pdf
B. Smith. (Architectural Portfolio.).pdfB. Smith. (Architectural Portfolio.).pdf
B. Smith. (Architectural Portfolio.).pdf
 
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
 

2 rel-algebra

  • 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!
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Table Definition: SQL-92 DDL and Constraints CREATE TABLE Takes (sid INTEGER, exp-grade CHAR(2), cid STRING(8), PRIMARY KEY (sid, cid), FOREIGN KEY (sid) REFERENCES STUDENT, FOREIGN KEY (cid) REFERENCES COURSE ) CREATE TABLE STUDENT (sid INTEGER, name CHAR(20), )
  • 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
  • 22. Join, ⋈  : A Combination of Product and Selection
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 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
  • 32.
  • 33.