Download Introduction to Database Systems CSSE 370 Fall Quarter 2008 SQL

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Open Database Connectivity wikipedia , lookup

SQL wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

PL/SQL wikipedia , lookup

Relational model wikipedia , lookup

Object-relational impedance mismatch wikipedia , lookup

Transcript
Introduction to Database Systems
CSSE 370
Fall Quarter 2008
SQL Homework
Due: Monday, November 10, 2008
Using the supplied MS Access Company database, construct the queries that will
satisfy the following statements. Feel free to add data to the database to get a
result for each query to aid in deciding if it was done correctly.
The database can be used to work on the query. When it is correct, cut and
paste the resulting SQL statement into a Word document.
You will be turning in a Word document containing the SQL statements you
created.
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.
k) 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.