Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Show the result of each of the sample queries in Section 6 . 5 as it would apply to the database state in Figure 3
Show the result of each of the sample queries in Section as it would apply to the database state in Figure
Query written answer needed as well as outcome
Query Retrieve the names of employees who have no dependents.
This is an example of the type of query that uses the MINUS SET DIFFERENCE operation.
ALLEMPS pi SsnEMPLOYEE
EMPSWITHDEPSSsnpi EssnDEPENDENT EMPSWITHOUTDEPS ALLEMPS EMPSWITHDEPS RESULT pi Lname, FnameEMPSWITHOUTDEPS EMPLOYEE
We first retrieve a relation with all employee Ssns in ALLEMPS. Then we create a table with the Ssns of employees who have at least one dependent in EMPSWITHDEPS. Then we apply the SET DIFFERENCE operation to retrieve employees Ssns with no dependents in EMPSWITHOUTDEPS, and finally join this with EMPLOYEE to retrieve the desired attributes. As a single inline expression, this query becomes:
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