Question

In: Computer Science

Instructions: Complete the following queries using the Colonial Adventure Tours database. You will find the description...

Instructions: Complete the following queries using the Colonial Adventure Tours database. You will find the description including data of this database in page 16 to page 20 in Chapter 1 in your Concepts of Database Management textbook. For each following question, create a query using the Query Design option in Access. Make sure that you save and name each query in the following manner: Query1, Query2......Query14. Query Questions:

Queries:

1. List the name of each trip that does not start in New Hampshire (NH).

2. List the last name of each guide that does not live in Massachusetts (MA).

3. List the name and start location for each trip that has the type Biking.

4. List the name of each trip that has the type Hiking and that has a distance greater than six miles.

5. List the name of each trip that has the type Paddling or that is located in Vermont (VT).

6. List the customer number, customer last name, and customer first name of each customer that lives in New Jersey (NJ), New York (NY) or Pennsylvania (PA).

7. How many trips have a type of Hiking or Biking?

8. List the trip name and state for each trip that occurs during the Summer season. Sort the results by trip name within state.

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. 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 ID, customer number, and total price for all reservations where the number of persons is greater than four. Use the column name TOTAL_PRICE for the calculated field.

12. What is the average distance and the average maximum group size for each type of trip?

13. How many current reservations does Colonial Adventure Tours have and what is the total number of persons for all reservations?

Solutions

Expert Solution

Below is the required queries with screenshots showing results:

Query 1:

SELECT Trip.TripName
FROM Trip
WHERE (((Trip.State)<>'NH'));

Query 2:

SELECT Guide.LastName
FROM Guide
WHERE (((Guide.State)<>'MA'));

Query 3:

SELECT Trip.TripName, Trip.StartLocation
FROM Trip
WHERE (((Trip.Type)='Biking'));

Query 4:

SELECT Trip.TripName
FROM Trip
WHERE (((Trip.Type)='Hiking') AND ((Trip.Distance)>6));

Query 5:

SELECT Trip.TripName
FROM Trip
WHERE (((Trip.Type)='Padding') OR ((Trip.State)='VT'));

Query 6:

SELECT Customer.CustomerNum, Customer.LastName, Customer.FirstName
FROM Customer
WHERE (((Customer.State)='NJ')) OR (((Customer.State)='NY') AND ((Customer.State)='PA'));

Query 7:

SELECT COUNT(*) AS TotalTrips
FROM Trip
WHERE (((Trip.Type)='Hiking')) OR (((Trip.Type)='Biking'));

Query 8:

SELECT Trip.TripName, Trip.State
FROM Trip
WHERE (((Trip.Season)='Summer'))
ORDER BY Trip.State, Trip.TripName;

Query 9:

SELECT Trip.State, Count(Trip.State) AS Trips
FROM Trip
GROUP BY Trip.State;

Query 10:

SELECT COUNT(*) AS Reservations
FROM Reservation
WHERE (Reservation.TripPrice)>20 AND (Reservation.TripPrice)<75;

Query 11:

SELECT Reservation.ReservationID, Reservation.TripID, Reservation.CustomerNum, (Reservation.NumPersons * (Reservation.TripPrice + Reservation.OtherFees)) AS TOTAL_PRICE
FROM Reservation
WHERE (((Reservation.NumPersons)>4));

Query 12:

SELECT Trip.Type, AVG(Trip.Distance) AS Average_Distance, AVG(Trip.MaxGrpSize) AS Average_MaxGrpSize
FROM Trip
GROUP BY Trip.Type;

Query 13:

SELECT COUNT(*) AS Total_Reservations, SUM(Reservation.NumPersons) AS Total_Persons
FROM Reservation;

This completes the requirement. Let me know if you have any questions.

Thanks!


Related Solutions

Colonial Adventure Tours Case The owner of Colonial Adventure Tours knows that being able to run...
Colonial Adventure Tours Case The owner of Colonial Adventure Tours knows that being able to run queries is one of the most important benefits of using a DBMS. In the following exercises, you will use the data in the Colonial Adventure Tours database 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...
Write the SQL queries that accomplish the following tasks using the AP Database 9. Write a...
Write the SQL queries that accomplish the following tasks using the AP Database 9. Write a select statement to show the invoicelineitemdescriptions that have the total invoicelineitemamount >1000 and the number of accountno is >2. 10. Write a select statement that returns the vendorid, paymentsum of each vendor, and the number of invoices of each vendor, where paymentsum is the sum of the paymentotal column. Return only the top ten vendors who have been paid the most and the number...
7. Using the provided schema of a Purchase Order Administration database, write the following queries in...
7. Using the provided schema of a Purchase Order Administration database, write the following queries in SQL. (In the schema, bold attributes are primary keys and italicized attributes are foreign keys.) SUPPLIER (SUPNR, SUPNAME, SUPADDRESS, SUPCITY, SUPSTATUS) SUPPLIES (SUPNR, PRODNR, PURCHASE_PRICE, DELIV_PERIOD) PRODUCT (PRODNR, PRODNAME, PRODTYPE, AVAILABLE_QUANTITY) PO_LINE (PONR, PRODNR, QUANTITY) PURCHASE_ORDER (PONR, PODATE, SUPNR) 7d) Write a nested SQL query to retrieve the supplier number, supplier name, and supplier status of each supplier who has a higher supplier status...
Create the following SQL queries using the lyrics database below 1. List the first name, last...
Create the following SQL queries using the lyrics database below 1. List the first name, last name, and region of members who do not have an email. 2. List the first name, last name, and region of members who do not have an email and they either have a homephone ending with a 2 or a 3. 3. List the number of track titles that begin with the letter 's' and the average length of these tracks in seconds 4....
Instructions: Using the following data, complete the requirements given below. When you are given amounts to...
Instructions: Using the following data, complete the requirements given below. When you are given amounts to assume as the answers to previous requirements, be careful to use such assumed amounts rather than your answers (in order to minimize carry-through errors). The Finishing Department of Curtis Corporation reports the following for January 2011: Production: All materials are added at the beginning of the process. Beginning work in process 20,000 units, 60% complete. Units started into production 240,000 units. Ending work in...
Proocess Costing Instructions: Using the following data, complete the requirements given below. When you are given...
Proocess Costing Instructions: Using the following data, complete the requirements given below. When you are given amounts to assume as the answers to previous requirements, be careful to use such assumed amounts rather than your answers (in order to minimize carry-through errors). The Finishing Department of Curtis Corporation reports the following for January 2011: Production: All materials are added at the beginning of the process. Beginning work in process 20,000 units, 60% complete. Units started into production 240,000 units. Ending...
Answer the following questions to complete Homework 1. Use PubMed or another abstract database  to find an...
Answer the following questions to complete Homework 1. Use PubMed or another abstract database  to find an academic journal article on a health topic of interest to you. Read the article to find the answers to these questions: (a) What was the main study question? (b) Who participated in the study, where did it take place, and when was it conducted? (c) What study design was used? and (d) What was the answer to the main study question? 2. Find a...
Instructions Complete the following problems using either a financial calculator or a spreadsheet program. Do not...
Instructions Complete the following problems using either a financial calculator or a spreadsheet program. Do not use interim rounding, state your answers as positive values, to two decimal places for dollar or period values and four places for percentages stated as decimals; do not label answers with symbols such as $ or %. For example, 10.5% should be input as .1050. An investment with quarterly compounding has a nominal rate of 0.0917. The effective rate is:
Please use the books database pasted under question 4 to design the following SQL queries. Use...
Please use the books database pasted under question 4 to design the following SQL queries. Use any method such as subqueries, equi-join/inner-join, outer join, EXISTS 1. Find the name(s) of the publisher(s) who have published the computer book. 2. Find the name(s) of the author(s) that have authored more than one books. 3. Find the name(s) of the publisher(s) who published the least expensive book. 4. Find the name(s) of the author(s) who wrote the book with the greatest number...
Please use the books database pasted under question 4 to design the following SQL queries. Use...
Please use the books database pasted under question 4 to design the following SQL queries. Use any method such as subqueries, equi-join/inner-join, outer join, EXISTS 1. List the title_name and book type of the books that are published earlier than the earliest biography book 2. List the title_name and book type of the books published by 'Abatis Publishers' 3. Find the name(s) of the publisher(s) that have not published any book 4. Find the name(s) of the publisher(s) who have...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT