Question: Problem 2 . ( 2 0 pts ) Understanding of SQL - I Consider the following relational schema. An employee can work in more than
Problem pts Understanding of SQL I
Consider the following relational schema. An employee can work in more than one department;
the pcttime field of the Works relation shows the percentage of time that a given employee
works in a given department.
Empeid: integer, ename: string, age: integer, salary: real
Workseid: integer, did: integer, pct time: integer
Deptdid: integer, dname: string, budget: real, managerid: integer
Use this schema and the material on SQL discussed in this class indicate which SQL statement
corresponds to the query been asked:
a pts Print the names and ages of each employee who works in both the Hardware
department and the Software department.
I. SELECT Eename, Eage
FROM Emp AS E Works AS W Works AS W Dept AS D Dept AS D
WHERE Eeid Weid AND Wdid Ddid AND Ddname Hardware
AND
Eeid Weid AND Wdid Ddid AND Ddname Software
II SELECT EEname, Eage
FROM Emp AS E Works AS W Dept AS D
WHERE Eeid Weid AND Wdid Ddid AND Ddname Hardware
AND Ddname Software
III. SELECT EEname, Eage
FROM Emp AS E Works AS W Dept AS D
WHERE Eeid Weid AND Wdid Ddid AND Ddname Hardware
INTERSECT
SELECT EEname, Eage
FROM Emp AS E Works AS W Dept AS D
WHERE Eeid Weid AND Wdid Ddid AND Ddname Software
IV Both I and II
V Both I and III
VI Both II and III
VII. All of the above
VIII. None of the above
Answer:
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
