Question
n this assignment, you are supplied a simple dataset for which you will write SQL queries. You will be using the well-known MySQL RDBMS for
n this assignment, you are supplied a simple dataset for which you will write SQL queries. You will be using the well-known MySQL RDBMS for this task. From the Resources section on Interact site, download the file DelightHotels.sql data file. Import this file into your MySQL installation by following the instructions on Interact site. The data file contains a schema and some sample data about bookings at several hotels which are part of the International Delight Hotels group. You can find records of some hotels, guests and their reservations. Note that guests make reservations at a hotel, with each reservation made up of one or more room bookings. All hotel rooms have an advertised rate, but actual booking cost varies depending on any discounts applied or partner commissions added. Write and execute SQL statement(s) to complete each of the following tasks. Copy your SQL statements into the assignment document. Secondly, include the screenshots of results obtained by executing those statements on the DBMS. Typing the results of SQL statements is NOT acceptable. 1.List the names and addresses of all Australian guests, alphabetically ordered by name. 2.What would be the total revenue per night from all 'Studio' rooms if all rooms are occupied and booked at their advertised rate? 3.How many bookings fall in October 2019? 4.List names of guests who have booked a room at the Beachside Apartments on 13th October 2019. 5.List the room numbers that are currently occupied at Holiday Inn Express. 6.List the hotel names and the total number of rooms in each hotel in Indonesia. 7.Create a 'view' containing the names of all hotels worldwide and their average room rate. Sort the view by increasing price. Finally display the view. 8.Find out how many children are accompanying Boris Johnson in each of his stays? Show the hotel names and corresponding number of children. 9.Find phone numbers of all the guests who have or had a booking at Crown Towers in room number 215. 10.Information about reservations older than 3 years are unlikely to be used in future. For performance reasons, such historical data can be moved to separate archive tables. Write SQL statements to create one or more archival tables with the same structure as original table(s). Using INSERT statement, copy the records of all historical bookings (that ended THREE years before today) from the original tables to the archive tables. Then delete all archived data from the original table(s). Note: You can recover the original data by reimporting the sql file. [1.5 marks 10]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started