Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Show the result of the sample query as it would apply to the database state in Figure 3 . 6 Query 4 . Make a
Show the result of the sample query as it would apply to the database state in Figure
Query Make a list of project numbers for projects that involve an employee whose last name is Smith either as a worker or as a manager of the department that controls the project.
SMITHSEssnpi Ssn sigma LnameSmithEMPLOYEE SMITHWORKERPROJS pi PnoWORKSON SMITHS
MGRS pi Lname, DnumberEMPLOYEE SsnMgrssnDEPARTMENT SMITHMANAGEDDEPTSDnumpi Dnumber sigma LnameSmithMGRS SMITHMGRPROJSPnopi PnumberSMITHMANAGEDDEPTS PROJECT RESULT SMITHWORKERPROJS cup SMITHMGRPROJS
In this query, we retrieved the project numbers for projects that involve an employee named Smith as a worker in SMITHWORKERPROJS. Then we retrieved the project numbers for projects that involve an employee named Smith as manager of the department that controls the project in SMITHMGRPROJS. Finally, we applied the UNION operation on SMITHWORKERPROJS and SMITHMGRPROJS. As a single inline expression, this query becomes:
pi Pno WORKSON EssnSsnpi Ssn sigma LnameSmithEMPLOYEEcup pi Pno pi Dnumber sigma LnameSmithpi Lname, DnumberEMPLOYEE SsnMgrssnDEPARTMENT DnumberDnumPROJECT
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started