Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!