Lab12 Fa23

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

LAB 12

Hotel (
Hotel_no char(4) NOT NULL,
Name varchar(4) NOT NULL,
Address varchar(50) NOT NULL
)
Room (
Room_no char(4) NOT NULL,
Hotel_no char(4) NOT NULL,
Type char(1) NOT NULL,
Price decimal(5,2) NOT NULL
)
Booking (
Hotel_no char(4) NOT NULL,
Guest_no char(4) NOT NULL,
Date_From datetime NOT NULL,
Date_To datetime NULL,
Room_no char(4) NOT NULL
)
Guest (
Guest_no char(4) NOT NULL,
Name varchar(4) NOT NULL,
Address varchar(50) NOT NULL
)
Note:
Dates: YYYY-MM-DD
Room type: 0 - private, 1 - double, 2 - twin, 3 - family
Update table Room: update values of the price column
Create a separate table with the same structure as the Booking table to hold archive
records.
Using the INSERT statement, copy the records from the Booking table to the
archive table relating to the booking before 1st January 2000.
Delete all bookings before 1st January 2000 from the Booking table.

Queries can be:


List type and price of each room.
Total income of each hotel (with more detail about date range, room type,…)
List the hotels according to the given keywords of the address.
List the available rooms related to the given keywords of the address, or hotels, or
room type, or date range.
List the name of guests in the given address, sorted by ascending or descending
name.
Total payment of the particular guest (for example, guest having name “Mickey”)

You might also like