CS 6360 004 Assignment 2 Due Date February 19 2016 11 59 PM 1 Write following queries in SQL a For each department whose average employee salary is more than 30 000 retrieve the department name and the number of employees working for that department b Same as a except output the number of male employees instead of the number of employees c Retrieve the names of all employees who work in the department that has the employee with the highest salary among all employees d Retrieve the names of employees who make at least 10 000 more than the employee who is paid the least in the company e Retrieve the names of employees who is making least in their departments and have more than one dependent solve using correlated nested queries 2 Specify following views in SQL Solve questions using correlated nested queries except a a A view that has the department name manager name and manager salary for every department b A view that has the department name its manager s name number of employees working in that department and the number of projects controlled by that department for each department c A view that has the project name controlling department name number of employees working on the project and the total hours per week they work on the project for each project d A view that has the project name controlling department name number of employees and total hours worked per week on the project for each project with more than one employee working on it e A view that has the employee name employee salary department that the employee works in department manager name manager salary and average salary for the department 3 Specify following queries in relational algebra a Retrieve the names of all employees in department 5 who work more than 10 hours per week on the ProductX project b List the names of all employees who have a dependent with the same first name as themselves c Find the names of all employees who are directly supervised by Franklin Wong d For each project list the project name and the total hours per week by all employees spent on that project e Retrieve the names of all employees who work on every project f Retrieve the names of all employees who do not work on any project g For each department retrieve the department name and the average salary of all employees working in that department h Retrieve the average salary of all female employees i Find the names and addresses of all employees who work on at least one project located in Houston but whose department has no location in Houston j List the last names of all department managers who have no dependents
View Full Document