/* Sample queries against the COMPANY database */


select e.ssn
  from employee e
 where e.lname = 'Wong';


select e.fname, e.lname, s.fname, s.lname
  from employee e, employee s
 where e.superssn = s.ssn;


select pnumber, dnum, lname, address, bdate
  from project, department, employee
 where dnum = dnumber
   and mgrssn = ssn
   and plocation = 'Stafford';


  select pnumber, pname, count(*)
    from project, works_on
   where pnumber = pno
group by pnumber, pname
  having count(*) > 2;
