# Database: SELECT on single table problems

Name: _________________________________

One point for each possible correct answer unless otherwise indicated. OPEN BOOK. You may also use a computer.

Answer each of the questions here with a SQL SELECT command. The following questions all apply to the charter flight database defined on p 102...104. Note that the Charter table is so wide that it has been listed in three pieces. All SELECT commands are for single tables. Two points per question.

1. List all aircraft.
2. List all aircraft numbers with their model codes.
3. List all pilots who do not have a commercial pilot license (COM).
4. List all customers who owe money (a positive balance).
5. List all customers who owe money (a positive balance) from highest to lowest balance (ie, descending).
6. List the first name, last name, and phone number for all customers in the 615 area code. Note that the phone information is not a numeric field, so it will need quotes around it.
7. List all employees without a middle initial.
8. List all female employees.
9. List all flights that used more than 400 gallons of fuel?
10. How many flights used more than 400 gallons of fuel?
11. What was the smallest amount of fuel used on a flight?
12. What is the average distance flown by pilot 104, when he was either a pilot or copilot on a flight?