Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

W7_SQL_v1

Code
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

W7_SQL_v1

Code
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Exercise 1: Consider the COMPANY relational database schema:

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”

b. Retrieve the names of all employees in the “Administration” department.

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.

h. Retrieve the average salary of all female employees.

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

You might also like