0% found this document useful (0 votes)
49 views5 pages

2023 s2 DB A1a SQLQueries

Uploaded by

michelle harjono
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views5 pages

2023 s2 DB A1a SQLQueries

Uploaded by

michelle harjono
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

SCHOOL OF AISSC

ISYS2421 - Business Data Management and Analytics

Assignment 1 – SQL Queries – Part A

Due Date: End of Week 3

CASE STUDY

Environmental Hotels
This special set of hotels are focused on achieving their corporate goals of attaining 6 star ratings for environmental
sustainability. They will examine the zone they have their hotel located and look to build or renovate a hotel that will
incorporate various sustainability concepts to reduce their carbon footprint and provide their guests a comfortable
experience.

This hotel chain look to advice provided by the Sustainable Hospitality Alliance to support their missiong to a create
sustainable hotel service: https://sustainablehospitalityalliance.org/resource/environmental-management-for-hotels/

The basic function of the hotel is to take bookings for rooms that are available for a given set of days. It is extremely
important that rooms are NOT double booked. There are limited number of rooms in each hotel. Currently, the hotel
group have three hotels, but they are looking to expand this under the sustainability umbrella. Guests who use the hotel
to stay a night or a number of nights may be charged for various service provided by the hotel, from the restaurant,
rooms service, minibar items, laundry, etc. Each room comes with various existing facilities. This data is used for
providing information on the website, answering guest queries and management reporting.

School of Accounting, Information Systems and Supply Chain Semester 2 - 2023


Business Data Management v1.0 Page 1 of 5
Relational Model

Entity-Relationship Diagram

HOTEL
GUEST

Linked Room in
Made
by

ROOM has BOOKING

has has

ITEM TRANSACTION for SERVICE

WIFI LAUNDRY FOOD CARPARK

Business Rules: Type in Item table is “C”leaning and safety practices, “E”ntertainment, “B”athroom, “S”leep
bed, “F”ood, and “O”ther.Price of a room is per night stayed. The Booking table status is “N”o rooms available,
“C”ancelled, “R”equested, and “A”ctive.

School of Accounting, Information Systems and Supply Chain Semester 2 - 2023


Business Data Management v1.0 Page 2 of 5
SPECIFICATIONS
Read the following questions carefully. You will be asked to specify SQL queries to answer them.

QUESTIONS

You will be working with a set of tables for a Hotel chain. You can access these tables by using
the HOTEL database on the MySQL server (mo.its.rmit.edu.au). You are to prepare 10 SQL
query statements that will provide answers to the following 10 requests for information. Please
note ALL these queries only required ONE table in the FROM clause.

1. As part of our ongoing efforts to optimize the guest experience and ensure sustainability in
our hotel operations, I would like to request a list of all the rooms within our hotel chain that
meet the following criteria: the rooms should have a minimum of 2 beds or more and the
cost of these rooms should be less than $400 per night.

2. Write a query requesting detailed information regarding all transactions made in June 2023
that involved the purchase of cookies from the minibar, specifically Service ID 16.
Obtaining this data will assist us in analysing guest preferences and consumption patterns,
enabling us to make informed decisions regarding our inventory and guest services. Could
you please provide all the details for each transaction that meets the specified criteria,
presented in descending order from the latest to the oldest.

3. As part of our marketing efforts to target specific guest demographics and personalize our
campaigns, I would like to request information regarding female guests who are over 50
years old, not from Victoria and the job title contains the word "Inspector". Obtaining this
data will allow us to tailor our marketing strategies and communications to better reach this
specific group of guests. By understanding their preferences and needs, we can create
targeted campaigns and offers that resonate with their interests. Could you kindly provide
the guest name, job title and age for each female guest.

4. As part of our operational planning and guest management, I would like to request the
details of all active bookings across all hotels within our chain that will be staying in the
hotel on the night of 24th July 2023. This includes bookings that are checking in on the 24th
of July and bookings that checked in before this date but will not check out until after the
24th. To ensure efficient guest services and optimise room allocations, it is crucial for us to
have a comprehensive understanding of the upcoming bookings for this specific date. By
accessing this information, we can effectively plan our resources, ensure a seamless guest
experience, and cater to any specific requests or requirements that our guests may have.

5. I would like to request a list detailing the number of rooms available for each hotel within
our chain, along with the average price of rooms for each respective hotel. Show only the
hotel_id, the number of rooms and the average price of rooms for each hotel. I kindly
request that this list be provided to me by 6th August 2023 to support our ongoing planning
and decision-making processes. If there are any challenges or limitations in obtaining this
information, please let me know, and we can discuss possible alternatives or adjustments.

6. So here's the deal: I need a list of our booking champions, the guests who have shown us
some serious love and have made over 150 bookings with us. �� These are the folks
who keep coming back for more of our epic hotel experiences, and we want to give them a
School of Accounting, Information Systems and Supply Chain Semester 2 - 2023
Business Data Management v1.0 Page 3 of 5
virtual high-five and maybe some extra pizzazz on their next stay! Now, I don't need all
their secret spy details; just their Guest_ID and the number of bookings they've made will do
the trick. We want to celebrate their dedication and show them they're part of our exclusive
Booking Rockstars Club! �� To make this epic list, we'll start with the guest who has
made the most bookings and work our way down. We're talking countdown-style, like the
top-charting songs of the summer! �� �

7. Request made during encounter at coffee machine


Personal Assistant: Hey, have you got a moment?
Database Guru: Sure, what's up?
Personal Assistant: Management was wondering if we could get some insights on our
customers' demographics. They specifically want to know the average age of customers for
each sex and also the number of guests for each sex. I know it's not the most exciting topic,
but it'll help them make some data-driven decisions.
Database Guru: No problem at all! I can definitely help with that. Just let me grab the data
from our records and crunch the numbers. I’ll generate the information for you.

8. Management has requested an urgent report to gain insights into the states from which most
of our guests originate. We need to identify the states that have more than 1300 guests
visiting our hotels. To meet this requirement, we need to create a query that displays the
state and the number of guests originating from each state. This will help us better
understand our customer base and tailor our services accordingly. We aim to provide the
report by the end of the day.

9. A small note from a new employee of the hotel group requesting information:
G'day,
How's it goin'? I hope this letter finds ya in high spirits, mate! I'm lookin' for some
information about some rooms at our ripper hotel chain.
Now, here's the thing. I'm after some info on how many bookings each of these rooms, from
29 to 96, have had during 2022, but I only wanna know about the ACTIVE bookings, you
feel me?
So, if ya could do me a solid and let me know the room_id and the number of active
bookings for each room, I'd be a happy camper, no doubt about it!
Cheers and lookin' forward to hearin' back from ya soon!
Ta.

10. In pursuit of precise data analysis, Management has requested a comprehensive report that
provides the number of bookings made for each month throughout the year 2022. To
represent the booking date, please use the "Date_booked" field from our records. To ensure
accuracy and maintain order, the report should display the month name and the
corresponding number of bookings made in a chronological sequence, starting from January
and concluding with December.

School of Accounting, Information Systems and Supply Chain Semester 2 - 2023


Business Data Management v1.0 Page 4 of 5
REQUIREMENTS
10 SQL queries that answer the questions asked, based on the data model, and
implemented database (on mo.its.rmit.edu.au) provided, alongside each query also provide
the number of rows generated when executed on the database server provided.

Example:

SELECT *
FROM hguest;

Number of rows: 19571

ASSESSMENT
Assessment of the data model will be based on the following areas (by the tutor):
• How well the query answers the questions, in relation to the case study provided.
• Understanding of data structure
• Efficiency and simplicity of resulting query

DEMONSTRATION
Selected students will be required to attend a demonstration session where they will be
asked to demonstrate and explain the queries they have written and to write several new
queries for the same database. Failure to explain the queries written or the inability to
write new queries will result in a FAIL mark being recorded for assignment 1 part a.

SUBMISSION
• SQL queries (output not required) AND number of rows generated by query.
• Assignment will be submitted online using Canvas
(https://rmit.instructure.com/courses/111064/assignments).
• By submitting online, you are observing adhering to all the requirements specified on a
standard assignment coversheet (e.g. Plagiarism).

School of Accounting, Information Systems and Supply Chain Semester 2 - 2023


Business Data Management v1.0 Page 5 of 5

You might also like