Search for question
Question

Submit a single sql file with multiple statements in it, one for each assignment below. Each query should end with a semicolon so that the entire script can be run at

once with no errors. Use a comment above each query to indicate which number of the assignment each query goes with. 1. Write a query that will return all reservations ordered by total price, with largest numbers first 2. Write a query that will return first name, last name, and email address for all guests who have booked more than 5 reservations with us ever. 3. Write a query that shows every reservation ID, name of rate plan, check in date, number of nights stayed, total number of rooms, and total number of people (adults and children combined) 4. Write a query that would let us determine the room type that has been reserved the most. 5. We want to see how we're doing year over year. Can you run a report that has a row for each year then shows the total number of reservations booked that year and the total price of all those reservations? It would be interesting to see if we've gotten more reservations this year than last. I hope so! 6. The marketing department wants to invite every guest that has stayed at one of the hotels to join the loyalty program. They want you to create an empty profile for every guest, then they will send an email to everyone asking them to log in and fill in the remaining details. Add a Loyalty Profile record for every guest in the database. Use the “Unknown" value for gender and leave all other fields NULL. 7. We are trying to plan a new rate plan to promote hotels with great pools. Can you run a query for me that gives me every hotel name and id where they have any reviews where the guest tagged the pool as something they liked and no reviews where the guest tagged the pool as a dislike? Thanks! 8. The billing department needs to send out invoices for all of the reservations in October 2023. Write a query that gives them Hotel ID, Hotel Name, and Commission Due for all hotels with reservations in October.Commission Due is calculated by multiplying the total amount of the reservation by the Rate Plan Billing Percentage if there is one, otherwise use the Default Billing Percentage for each hotel. There should be only one record per hotel in your results./nIS451 F23 HW4 HW7: DQL SQL II For all of the below assignments you must first run the scripts provided in D2L in order for your commands to work in Oracle SQL Developer. These are also the scripts I will be running when grading. Run the scripts in this order (these are NOT exactly the same as previous assignments, get the new ones): IS451_HW7_SQL_HOTEL_DDL.sql IS451_HW7_SQL_HOTEL_INSERTS.sql 1. 2. Now you will have the full Hotel database with data in all of the tables.

Fig: 1

Fig: 2