Digital Academic Solutions

CSE2DBF 2020 Assignment 2: Reservation Database

SOLUTION AVAILABLE AT: http://libraay.com/downloads/cse2dbf-2020-assignment-2-reservation-database/

Problem:

The list of tables available for this assignment is the following:

CLIENT (ClientNo, Name, Sex, DOB, Address, Phone, Email, Occupation, MaritalStatus, Spouse, Anniversary) CCONDITION (ClientNo, Condition) RESERVATION (ResNo, ResDate, NoOfGuests, StartDate, EndDate, ClientNo, Status) ACTIVITY (ActivityID, ActName, ActDescription, ActRate, RiskLevel) OUTDOOR_ACTIVITY (ActivityID) INDOOR_ACTIVITY (ActivityID, Location, OpeningHours) ACCOMMODATION (RoomNo, LevelNo, AccStatus, ConnectedRoomNo, AccTypeID)
ACCOMMODATION_TYPE (AccTypeID, AccTypeName, AccTypeRate, NoOfBeds) EQUIPMENT (EquipmentID, EquipName, Stock, NextInspection) SUPPLIER (BillerCode, BusinessName, ContactPerson, Phone) SUPPLIES (EquipmentID, BillerCode) USES_EQUIPMENT (ActivityID, EquipmentID) CLIENT_PREFERENCE (ClientNo, ActivityID) RESERVATION_ACCOMMODATION (ResNo, RoomNo) ACTIVITY_SUPERVISOR (SupervisorID) OUTDOOR_INSTRUCTOR (InstructorID, InstrName, InstrPhone, SupervisorID) IFIELD (InstructorID, Field) MASSEUSE (MasseuseID, MassName, MassPhone, Area, SupervisorID) SWIMMING_INSTRUCTOR (SwimmerID, SwimName, SwimPhone, SupervisorID) SUPERVISION (ResNo, ActivityID, SupervisorID, Day, Time)

NOTE: PK is printed underlined and FK is printed italic in italics.

Task 1 [50 marks]
Using the tables provided above, provide SQL statements for the following queries.
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 outdoor instructor who has the most duties as an activity supervisor.
e. Display the reservations (reservation number and duration) whose duration is greater than the average duration of reservations.
Hint: in SQL, if you subtract two dates, what you get is a difference in days between those dates.

Task 2 [30 marks]
Provide the implementation of the following stored procedures and function. For submission, please include both the PL/SQL code and an execute procedure/SQL statement to demonstrate the functionality.
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 reservation number, activity ID, and date as input and returns the Name of the supervisor assigned for that specific activity.

Task 3 [20 marks] 
Provide the implementation of the following trigger. For submission, please include both the PL/SQL code and an insert statement to demonstrate the trigger functionality.
a. A Trigger which automatically raises an error whenever a client with Aqua phobia selects Rafting as a preferred outdoor activity.

SOLUTION AVAILABLE AT: http://libraay.com/downloads/cse2dbf-2020-assignment-2-reservation-database/

Leave a Reply

Your email address will not be published. Required fields are marked *



Solutions Authored by 15+ Years Experienced Industry Expert