CSC 455

Fall 2009

Lab 12

Specify the following queries on the COMPANY relational database schema shown in Figure 5.7, using the relational operators discussed in this chapter. Also show the result of each query as it would apply to the database state of Figure 5.6.

 

(a)    List the names of employees who have a dependent with the same first name as themselves.

 

 

(b)  Retrieve the names of employees in department 5 who work more than 10 hours per week on the 'ProductX' project.

 

 

 (c) Find the names of employees that are directly supervised by 'Franklin Wong'.

 

 

 (d) Retrieve the names of employees who do not work on any project.

 

 

(e) For each project, list the project name and the total hours per week (by all employees) spent on that project.

 

 

 (f) For each department, retrieve the department name, and the average salary of employees working in that department.

 

 

fig05_07

fig05_06