Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Retrieve the first name, last name, and SSN of each employee along with the d

ID: 3573557 • Letter: 1

Question

1. Retrieve the first name, last name, and SSN of each employee along with the department name he/she is working for.

2. For each project, retrieve its name and the names of employees who work on the project.

3. For each project, retrieve its name, controlling department’s name, and the names of employees who work on the project.

4. Retrieve the number of employees who work on the project "Product X".

5. Retrieve the SSNs of employees who don’t have a dependent.

6. Retrieve the names and SSNs of employees who have at least two dependents.

7. Retrieve the names of employees who work on the projects of both “Product X” and “Product Y”.

8. Retrieve the first name and last name of employees who has the highest salary

EMPLOYEE RAME MNT UNAME SSN BDATE ADDRESS SEX SALARY SUPERSSN DINO DEPARTMENT DINAME DUMBER MGRSSN MGRSTARTDATE DEPT LOCATIONS DNUMBER DLOCATON PROJECT WORKS ON ESSN PNO HOURS DEPENDENT ESSN DEPENDENT NAME SEX BDATE

Explanation / Answer

1. Select e.fname, e.lname, e.ssn,d.dnam
From Employees e, Department d
Where e.dno=d.dnumber;

2. Select p.pname, e.fname
From Project p, Employeed e
   where p.dnum=e.dno;

3. Select p.pname, d.dnam,e.fname
   From Project p, Department d, Employee e
Where p.dum=d.dnumber AND p.dum=e.dno;

4. Select count(e.fname) "work for the project X"
From Employees e, Project p
   where p.pname="Project X" AND p.dnum=e.dno;