Question: Show the result of the sample query as it would apply to the database state in Figure 3 . 6 Must be answered in writing
Show the result of the sample query as it would apply to the database state in Figure
Must be answered in writing not with an image of the query.
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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
