Question: Consider the following relation schemas. The primary keys are underlined. All attributes are of type string if not indicated otherwise. Use multi-step and multi-line queries
Consider the following relation schemas. The primary keys are underlined. All attributes are of type string if not indicated otherwise. Use multi-step and multi-line queries to ease the formulation of queries. Use the rename operator to give intermediate query results a name (some textbooks use the equivalent notation). Aggregate functions as you can find them defined in some textbooks are not allowed, neither in homework assignments nor in exams. [Note: If the location of your answer for a question is not correctly specified in Gradescope, one point will be deducted.]
Hotels(hID, name, location, phone, avgRating: integer)
Rooms(rID, hID, type, price, availability: boolean)
Bookings(bID, rID, hID, gID, startDate, endDate, totalCost: integer)
Guests(gID, name, phone, address)
Amenities(amenityID, name, description)
HotelAmenities(hID, amenityID) HotelReviews(hID, gID, rating: integer, review)
(a) [5 points] Find the names of hotels, their available room types, and prices. The hotels should be located in Orlando and should have amenities such as free breakfast and a pool (amenity name) available.
(b) [5 points] Find the names of guests who have made more than one booking at HotelA (unique name).
(c) [5 points] Find the names of guests who have made a booking with HotelA (unique name) but have not reviewed the hotel yet.
(d) [5 points] Find the reviews and ratings of HotelA (unique name) given by either GuestA or GuestB (unique names).
(e) [5 points] Find the names of hotels in Orlando with the highest average rating. Display the hotel names and ratings together.
(f) [5 points] Find the names of guests who have booked every hotel in Orlando
Please dont post the old answers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
