The owner of Colonial Adventure Tours knows the importance of the SQL language in database management. He

Question:

The owner of Colonial Adventure Tours knows the importance of the SQL language in database management. He realizes that he can use SQL to perform the same functions that you performed with queries in Chapter 2. In each of the following steps, use SQL to obtain the desired results using the data shown in Figures 1-15 through 1-19 in Chapter 1. (If you use a computer to complete these exercises, use a copy of the Colonial Adventure Tours database, so you will still have the original data when you complete Chapter 4.) You can use a DBMS to complete the exercises using a computer, or you can simply write the SQL command to complete each step. Check with your instructor if you are uncertain about which approach to take.
1. List the name of each trip that does not start in New Hampshire (NH).
2. List the name and start location for each trip that has the type Biking.
3. List the name of each trip that has the type Hiking and that has a distance of greater than six miles.
4. List the name of each trip that has the type Paddling or that is located in Vermont (VT).
5. How many trips have a type of Hiking or Biking?
6. List the trip name, type, and maximum group size for all trips that have Susan Kiley as a guide.
7. List the trip name and state for each trip that occurs during the Summer season. Sort the results by trip name within state.
8. List the name of each trip that has the type Hiking and that is guided by Rita Boyers.
9. How many trips originate in each state?
10. How many reservations include a trip with a price that is greater than $20 but less than $75?
11. List the reservation ID, customer last name, and the trip name for all reservations where the number of persons included in the reservation is greater than four.
12. List the trip name, the guide€™s first name, and the guide€™s last name for all trips that originate in New Hampshire (NH). Sort the results by guide€™s last name within trip name.
13. List the reservation ID, customer number, customer last name, and customer first name for all trips that occur in July 2016.
14. Colonial Adventure Tours calculates the total price of a trip by adding the trip price plus other fees and multiplying the result by the number of persons included in the reservation. List the reservation ID, trip name, customer€™s last name, customer€™s first name, and total cost for all reservations where the number of persons is greater than four. Use the column name TotalCost for the calculated field.
15. Create a new table named Solo that includes the reservation ID, trip ID, trip date, trip price, other fees, and customer number for all reservations that are for only one person.
16. Use an update query to change the OtherFees value in the Solo table to $5.00 for all records on which the OtherFees value is $0.00.
17. Use a delete query to delete all trips in the Solo table where the trip date is 9/12/2016.
18. There are multiple ways to create the query in Step 13. Write the SQL command that you used and then write an alternate command that also would obtain the correct result.

19. The following SQL code produces an error message. What is wrong with the code and how would you correct it?
SELECT ReservationID, TripID, TripName
FROM Reservation, Trip
WHERE Reservation.TripID¼Trip.TripID;


Figure 1-15

GuideNum LastName FirstName Address State PostalCode PhoneNum City HireDate Miles 54 Quest Ave. 140 Oakton Rd. 25 Old Ra

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Concepts of Database Management

ISBN: 978-1285427102

8th edition

Authors: Philip J. Pratt, Mary Z. Last

Question Posted: