|
|
|
select pname from project where pnumber in { pnumber of project w.o. by an employee in 'R' department } |
|
Find projects worked on by employees in the Research department select pname, ssn, fname, lname, dname from works_on, project, employee, department where essn=ssn and pno = pnumber and dno = dnumber and dname = 'Research' order by pname |
select pname from project P where count({ employees in Research dept who work on P}) >= 2 |
|
Solution Method: establish the relationship between 2 relevant sets of employees
|
select pname from project p where { ssn of employee working on project p.pnumber } CONTAINS { ssn of employee working in 'Research' dept } |
|
Solution technqiue: use a superset/subset relationship
|
select pname from project p where { ssn of employee working in 'Research' dept } CONTAINS { ssn of employee working on project p.pnumber } |
|
Solution Method: use empty-set test (see: click here)
select pname from project P where no employee in Research department works on P |
|
Comment:
|