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

1. Retrieve the employee ids, first and last names who work for department numbe

ID: 3729392 • Letter: 1

Question

1. Retrieve the employee ids, first and last names who work for department number 2 3 pts) (3 pts Retrieve first and last name of the employee whose id 5; display result in sorted order by last name and Operations departments Retrieve first & last names of the employees and project numbers they are working on for manager 2. eve first & last names of the employees and department names who work for an 'Payroll' (5 pt whose id is 5 (51 5. Retrieve first & last names of the employees, department names they are working for and project numbers they are working on 6. Retrieve fist & last names of the customers, city and state names who DO NOT live in San Francisco 7. Retrieve fist & last names and phone number of all the customers whose area code is 309 8. Display number of all available departments 9. Display number of the employees working for 'Payroll' department 10. Retrieve the highest and lowest salary amounts for all male employees and Chicago' in sorted order by last name

Explanation / Answer

1) SELECT EMPLOYEE_ID,LAST_NAME,FIRST_NAME FROM EMPLOYEES WHERE DEPARTMENT_NUMBER = 2;

2) SELECT LAST_NAME,FIRST_NAME FROM EMPLOYEES WHERE MANAGER_ID=5 ORDER BY LAST_NAME;

3) SELECT E.LAST_NAME,E.FIRST_NAME FROM EMPLOYEES E,DEPARTMENTS D WHERE E.DEPARTMENT_NUMBER=D.DEPARTMENT_NUMBER AND D.DEPARTMENT_NAME='payroll' AND D.DEPARTMENT_NAME='Operations';

4)SELECT E.LAST_NAME,E.FIRST_NAME,P.PROJECT_NUMBER FROM EMPLOYEES E,DEPARTMENTS D, PROJECTS P WHERE E.DEPARTMENT_NUMBER=D.DEPARTMENT_NUMBER AND E.EMPLOYEE_ID=P.EMPLOYEE_ID AND E.MANAGER_ID=5;