Do the following exercises:

  1. Please write SQL queries that retrieve the following information from the HR database (see HR and OE Schemas).

    1. The IDs and full names of managers and the number of employees each of them manages. Order the results by decreasing number of employees and return only the top ten results.
    2. The name, number of employees and total salary for each department outside of the US with less than 100 employees. The total salary is the sum of the salaries of each of the department's employees.
    3. The department name, department manager name and manager job title for all departments. If the department has no manager, include it in the output with NULL values for the manager and title.
    4. The name of each department along with the average salary of the employees of that department. If a department has no employees, include it in the list with no salary value. Order your results by decreasing salary. You may order the NULL-valued salaries however you’d like.

    Store your results in homework06_1.sql.

Checking in

We will grade your work according to the following criteria: