Saturday, January 7, 2012

ITC 222 Assignment Five

Sub Queries




Problems


For each of these problems use subqueries for all parts of the problem, even though joins may make more sense to you.

1. List the name and price of the service with the maximum price.

2. Get a list of the first and last names of every person who is an employee.

3. Get a list of all the employee supervisors.

4. List the name of every person who is not a registered customer.

5. Get the license make and year of every vehicle that has been served. Some may appear more than once. You can use DISTINCT to not show duplicates.

6. Get the same information as in number five but only for those vehicles that have had service 12 completed on them.

7. Now repeat the query above, but include the service name in the select clause. (Remember, no inner joins).

8. Get the service price, the average service price and the difference between the two for every service. Sort them in descending order by service price. (This is one that can only be done with subqueries).



What I am looking for


I want only sub queries. 1 through 6 are worth 1 point each. 7 and 8 are worth 2 points each.


To Turn in


Post the SQL in a Google doc. Share it with spconger@gmail.com

No comments:

Post a Comment