Example
This presentation is the property of its rightful owner.
Sponsored Links
1 / 1

PNO PowerPoint PPT Presentation


  • 89 Views
  • Uploaded on
  • Presentation posted in: General

Example. Schema : Employee (ENO, ENAME, TITLE) Works_On (ENO, PNO, RESP, DUR) Project (PNO, PNAME) Query : “Find the names of employees other than J. John who worked on the CAD/CAM project for either one or two years”. The SQL expression : SELECT ENAME

Download Presentation

PNO

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Pno

Example

Schema:

Employee (ENO, ENAME, TITLE)

Works_On (ENO, PNO, RESP, DUR)

Project (PNO, PNAME)

Query:

“Find the names of employees other than J. John

who worked on the CAD/CAM project for either

one or two years”.

The SQL expression:

SELECT ENAME

FROM Project, Employee, Works_On

WHERE Works_On.ENO = Employee.ENO

AND Works_On.PNO = Project.PNO

AND Employee.ENAME  ‘J. John’

AND Project.PNAME = ‘CAD/CAM’

AND (Project.DUR = 12 OR Project.DUR = 24)

Project

Select

PNO

Join

ENO

Project

Works-On

Employee

Figure 1: Operator Tree

PNO

ENO

Project

Works-On

Employee

Employee

Project

Works-On

Figure 2: Another Operator Tree

Figure 3: Operator Tree after applying the restrictions


  • Login