Answered step by step
Verified Expert Solution
Link Copied!

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 3.6
Query 4. 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.
SMITHS(Essn)\pi Ssn (\sigma Lname=Smith(EMPLOYEE)) SMITH_WORKER_PROJS \pi Pno(WORKS_ON * SMITHS)
MGRS \pi Lname, Dnumber(EMPLOYEE Ssn=Mgr_ssnDEPARTMENT) SMITH_MANAGED_DEPTS(Dnum)\pi Dnumber (\sigma Lname=Smith(MGRS)) SMITH_MGR_PROJS(Pno)\pi Pnumber(SMITH_MANAGED_DEPTS * PROJECT) RESULT (SMITH_WORKER_PROJS \cup SMITH_MGR_PROJS)
In this query, we retrieved the project numbers for projects that involve an employee named Smith as a worker in SMITH_WORKER_PROJS. Then we retrieved the project numbers for projects that involve an employee named Smith as manager of the department that controls the project in SMITH_MGR_PROJS. Finally, we applied the UNION operation on SMITH_WORKER_PROJS and SMITH_MGR_PROJS. As a single in-line expression, this query becomes:
\pi Pno (WORKS_ON Essn=Ssn(\pi Ssn (\sigma Lname=Smith(EMPLOYEE)))\cup \pi Pno ((\pi Dnumber (\sigma Lname=Smith(\pi Lname, Dnumber(EMPLOYEE))) Ssn=Mgr_ssnDEPARTMENT)) Dnumber=DnumPROJECT)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Describe the limbic systems structures and functions.

Answered: 1 week ago

Question

Discuss the different types of leadership

Answered: 1 week ago

Question

Write a note on Organisation manuals

Answered: 1 week ago

Question

Define Scientific Management

Answered: 1 week ago

Question

Explain budgetary Control

Answered: 1 week ago