Find the names of employees who are not working on the project that is not contr
ID: 3799344 • Letter: F
Question
Find the names of employees who are not working on the project that is not controlled by the employee’s own department. (Employees who work on only the employee’s own department’s projects).
EMPLOYEE B Smith 1234067B9 1960-01-09 731 Fondren, Houston, TX M 30 Franklin T Ramesh K Narayan 666824444 1902-09-1505FreOak Humbe, TXM 35000 33445500 5 Ahmad V Jabbar 987987987 1969-03-29 980 Dallas, Houston, TX M 200 IJames E Borg 688665500 193-11-10 450 Stone, Houston, TX M 50000 NULL DEPT LOCATIONS DEPARTMENT Administration 4 21 1985 0101 4 Stanford Headquarters 1 688665555 1961-06-19 5 Sugarland Houston WORKS ON PROJECT Product 1 Belaina 123456789 2 75 666884444 3 400 403453403 1 20.0 Reorganization 20 Houston 1 33440000 2 10.0 DEPENDENT Relationship 666665555 20 NULL 123456789 Elizabeth F 19 SpouseExplanation / Answer
This query in Oracle should do the job.
select e.ssn, e.Fname || ' ' || e.Lname
from employee e
where NOT EXISTS
(
select w.Essn from works_on w , project p
where w.Pno = p.Pnumber
AND
w.Essn = e.ssn
AND
p.Dnum != e.Dno
);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.