0% found this document useful (0 votes)
2 views2 pages

Tutorial 6

The document outlines a database structure for a hotel management system, detailing four tables: Hotel, Room, Booking, and Guest, along with their primary keys. It includes a series of SQL queries to extract specific information such as guest details, hotel counts, average room prices, total revenue from double rooms, and room details for a specific hotel. The queries aim to provide insights into hotel operations and guest demographics.
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)
2 views2 pages

Tutorial 6

The document outlines a database structure for a hotel management system, detailing four tables: Hotel, Room, Booking, and Guest, along with their primary keys. It includes a series of SQL queries to extract specific information such as guest details, hotel counts, average room prices, total revenue from double rooms, and room details for a specific hotel. The queries aim to provide insights into hotel operations and guest demographics.
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

CC116 DBMS/CB203 DB Systems

Tutorial 6

Question:

The following tables form part of a database held in a relational DBMS.

Hotel (hotelNo, name, address)


Room (roomNo, hotelNo, type, price)
Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)
Guest (guestNo, name, address)

where

• Hotel contains hotel details and hotelNo is the primary key.


• Room contains room details for each hotel and roomNo, hotelNo forms the
primary key.
• Booking contains details of the bookings and the primary key comprises
hotelNo, guestNo and dateFrom.
• Guest contains guest details and guestNo is the primary key.

Construct an SQL statement to answer the following queries.

1. List the names and addresses of all guests in London, alphabetically ordered by
name.

2. How many hotels are there?

3. What is the average price of a room?

4. What is the total revenue per night from all double rooms?

5. List the price and type of all rooms at the Grosvenor Hotel.
CC116 DBMS/CB203 DB Systems

You might also like