Question: Group all stays by the percent difference from rate was from the base price. For each grouping, list the percent difference (e.g., 15% off the
Group all stays by the percent difference from rate was from the base price. For each grouping, list the percent difference (e.g., 15% off the base price would show as -15) and the total number of days with that percent difference. Sort the results by the total number of days in ascending order.
Rooms: RoomId : a three-letter unique Id code of a room roomName : official name of the room beds : number of beds in the room bedType : type of the bed(s) in the room. All beds in each room are of the same type. maxOccupancy : maximum number of people allowed to stay in the room basePrice : base price (in US dollars) of one night of stay in the room. decor : decoration style of the room
Reservations Code : reservation code Room : the three-letter room code (see Rooms.RoomId) CheckIn : date of check-in/arrival CheckOut : date of check-out/departure Rate : actual nightly rate. Each night of stay on one reservation always costs the same amount, although rates may vary for the same room from one reservation to another LastName : last name of the person who made the reservation FirstName : first name of the person who made the reservation Adults : number of adults (18 and above) staying in the room. Each reservation must have at least one adult Kids : number of kids (ages 0-17) staying in the room.
EXPECTED:
| -15 | 162 |
| 25 | 208 |
| -10 | 458 |
| 15 | 510 |
| 0 | 833 |
PLZ explain
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
