/* Query 4 (page 137, 225 of the text book)

   Make a list of project numbers that involve an employee whose last name is 'Wong',
   either as a worker or as manager of the controlling department for the project.

   The result must be
	1
	2
	3
	10
	20

*/

   (select distinct pnumber
    from project, department d, employee e
    where e.dno = d.dnumber and mgrssn = ssn and lname = 'Wong'
   )
   union
   (select distinct p.pnumber
    from project p, works_on w, employee e
    where p.pNumber = w.pno and w.essn = e.ssn and lname = 'Wong'
   )
;
