W7_SQL_v1
W7_SQL_v1
Specify the following queries in SQL, and also show the result of each query as it would apply to
the database state in page 2.
a. Retrieve the name, birth date and address of the employee(s) whose name is “John B.
Smith”
c. Retrieve the names of all employees in department 5 who work more than 10 hours per
week on the ProductX project.
d. For each employee, retrieve the employee’s first name and last name and the first and last
name of his/her immediate supervisor.
e. Retrieve the names of all employees in the departments which are located in Houston
f. List the names of all employees who have a dependent with the same first name as
themselves
g. For each project, calculate the total number of employees who work for it, and the total
number of hours that these employees work for the project.
i. For each department whose average employee salary is more than $30.000, retrieve the
department name and the number of employees work for that department.
References:
http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10759/toc.htm
http://www.java2s.com/Tutorial/Oracle/CatalogOracle.htm