Getaway Holidays SQL Queries

Download Solution: Click to Download Solution
Solution File Name: GetawayHolidaysSQLQueries.docx
Unzip Password:

Task 1

a. Display the name of the client who has made the most reservations with Getaway Holidays

b. Display the name of the client who has booked the reservation for the longest period
c. Display the Room no, Room type, Room rate and No of guests for the reservation made by client(s) having last name “Perez”

d. Display the Name of the equipment and the name of their suppliers (if any) for the outdoor activities with high risk level.
e. Display the details of those reservation that contains a minimum of one set of connected rooms.

f. Display the name of the outdoor instructor who has the most duties as an activity supervisor.
g. Display the name, address and phone number for the clients who has not made any reservations for the past two months. (Name should be displayed in alphabetical order).

h. For each reservation, display the total income coming from activities & total income coming from accommodations along with the reservation number. (Do not consider the discount schemes but consider every reservation even if it does not have any of the costs associated with it)
i. Display the reservations (Reservation number and duration) whose duration is greater than the average duration of reservations.

j. Display the top two most popular activities across all reservations

Task 2
a. Write a stored procedure that displays the contact details of clients who does not have any heart conditions or Acrophobia. The resort wants to promote a new outdoor activity to them

b. Write a stored function that uses the activity ID and date as input and returns the Name of the supervisor assigned for that day

c. Write a stored procedure that accepts a particular reservation number as input, and as output displays the total layout of the trip in terms of outdoor and indoor activities along with the name of the client and the name of the activity supervisor assigned for each of the activity.
(NOTE: this stored procedure should use the function created in Task 2b)

Task 3
a. A trigger which automatically raises an error whenever a client with Aqua phobia selects Rafting as a preferred outdoor activity
Test Trigger:

b. A trigger that automatically calculates and stores in a separate table called“Reservation_room_expense” the reservation number and the due amount for accommodations for each record number. 
(Consider the 5% discount on room prices if the trip consists of more than 5 days)
Test Trigger:

Add Comment