Gokul
Gokul
Exercise – 2
For the relational schema given as part of Assessment – 1, write the SQL queries using joins to get the following
information.
1) Retrieve the names of all employees in department 5 who work more than 10 hours per week on ProductX
project.
2) List the names of all employees who have a dependent with the same first name as themselves.
3) Find the names of all the employees who are directly supervised by ‘Franklin Wong’.
4) Retrieve the names of all who do not work on any project.
5) 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.
6) List the names of all managers who have no dependents.
7) List the employee’s names and the department names if they happen to manage a department.
8) For each project retrieve the project number, project name and the number of employees who work on that
project.
9) For each project, list the project name and the total hours per week (by all employees) spent on that project.
10) Retrieve the names of the employees who have 2 or more dependents.