Beruflich Dokumente
Kultur Dokumente
SQL Query:
SELECT Count(Trip.TripName) AS CountOfTripName, Trip.Type
FROM Trip
GROUP BY Trip.Type, Trip.Type
HAVING (((Trip.Type)="hiking" Or (Trip.Type)="biking"));
Answer:
10. How many reservations include a trip with a price that is greater than $20 but less than $75?
SQL query:
SELECT Count(Reservation.ReservationID) AS CountOfReservationID
FROM Reservation
WHERE (((Reservation.TripPrice) Between 20 And 75));
Result:
13. List the reservation ID, customer number, customer last name, and customer first name for all trips
that occur in
July, 2016.
SQL query:
SELECT Reservation.ReservationID, Customer.CustomerNum, Customer.LastName, Customer.FirstName
FROM Customer INNER JOIN Reservation ON Customer.CustomerNum = Reservation.CustomerNum
Result:
16. Use an update query to change the OtherFees value in the Hiking table to $5.00 for all records on
which the
OtherFees value is $0.00.
SQL query for creating hiking table:
SELECT Reservation.* into hiking
FROM Trip INNER JOIN Reservation ON Trip.TripID = Reservation.TripID
WHERE (((Trip.Type)="hiking"));
Before Updating:
SQL query:
UPDATE hiking
SET hiking.OtherFees = 5
WHERE hiking.OtherFees=0;
17. Use a delete query to delete all trips in the Hiking table where the trip date is 6/12/2016.
SQL query:
DELETE hiking.TripDate
FROM hiking
WHERE (((hiking.TripDate)=#6/12/2016#));
Result:After deleting