You are on page 1of 4

Prelim Project: Theory of Database

Perform the following


1. Create a database named Theodbs_Prelim_Project
2. Create a table for what is being asked and fill in the fields for each table using
the provided data below:
a. For Hotel Table:
hotelNo
H001
H002
H003
H004
H005

hotelName
MANDARIN
THE QUEST
ATRIUM
AMIGO
HOLIDAY

City
LOS ANGELES
NEW YORK
WASHINGTON
SAN DIEGO
RALEIGH

b. For Room Table:


RoomNo
R001
R002
R003
R004
R005

hotelNo
H001
H002
H003
H004
H005

type
SINGLE ROOM
SUPERIOR SUITE
EXECUTIVE
FAMILY SUITE
GRANDE SUITE

c. For Booking Table:


hotelNo
H001
H002
H003
H004
H005

guestNo
G001
G002
G003
G004
G005

dateFrom
JANUARY
JULY
FEBRUARY
AUGUST
MARCH

dateTo
DECEMBER
NOVEMBER
MAY
DECEMBER
APRIL

room
R001
R002
R003
R004
R005

d. For Guest Table:


guestNo
G001
G002
G003
G004
G005

guestName
ALBERT
MHEL
PHOEBE
CEL
GENG

3. Write an SQL Statement that will display the following output

Prepared by: Sir Christopher Lee C. Villablanca

guestAddress
KENTUCKY
CALIFORNIA
ARIZONA
ALASKA
OHIO

Price
$500
$1000
$1500
$2000
$2500

Prelim Project: Theory of Database


a. Write a code that will show the results of the Hotel Number, Room
Number, Date from and Date to from the booking table records of
Guest and Guest 3
hotelNo
H003
H005

dateFrom
FEBRUARY
MARCH

DateTo
MAY
APRIL

roomNo
R003
R005

b. Write a code that will show all the results of Table Booking.
hotelNo
H001
H002
H003
H004
H005

guestNo
G001
G002
G003
G004
G005

dateFrom
JANUARY
JULY
FEBRUARY
AUGUST
MARCH

dateTo
DECEMBER
NOVEMBER
MAY
DECEMBER
APRIL

room
R001
R002
R003
R004
R005

c. Write a code that will show the results of the Guest Name and Guest
Address of Guest 1, Guest 2 and Guest 4 from the Guest Table.
guestName
ALBERT
MHEL
CEL

guestAddress
KENTUCKY
CALIFORNIA
ALASKA

d. Write a code that will show the results of the Hotel Number, Guest
Number, and Room Number of the Guests that have booked from July
to November, February to May, August to December From the Booking
Table.
hotelNo
H002
H003
H004

guestNo
G002
G003
G004

roomNo
R002
R003
R004

e. Write a code that will show the results of all the Guest Number, Date
From, and Date to records of Guest 1 to Guest 5 from the Booking
Table.
guestNo
G001
G002
G003
G004
G005

Prepared by: Sir Christopher Lee C. Villablanca

dateFrom
JANUARY
JULY
FEBRUARY
AUGUST
MARCH

dateTo
DECEMBER
NOVEMBER
MAY
DECEMBER
APRIL

Prelim Project: Theory of Database


f.

Write a code that will show the results of the Guest Name and Guest
Address of the Names: MHEL, PHOEBE, and CEL from the Guest Table
and the Price and Type of rooms from the Room Table.
i.
guestName
MHEL
PHOEBE
CEL

guestAddress
CALIFORNIA
ARIZONA
ALASKA

price
$500
$1000
$1500
$2000
$2500

Type
SINGLE ROOM
SUPERIOR SUITE
EXECUTIVE SUITE
FAMILU SUITE
GRANDE SUITE

ii.

g. Write a code that will show all the results of the Table Room.
RoomNo
R001
R002
R003
R004
R005

hotelNo
H001
H002
H003
H004
H005

type
SINGLE ROOM
SUPERIOR SUITE
EXECUTIVE
FAMILY SUITE
GRANDE SUITE

Price
$500
$1000
$1500
$2000
$2500

h. Write a code that will show the results of Hotel Name and City of the
Hotel Numbers: H002, H003, H004, from the table Hotel.
hotelName
THE QUEST
ATRIUM
ARRIGO
i.

City
NEW YORK
WASHINGTON
SAN DIEGO

Write a code that will show the results of the Guest Number, Guest
Name, Guest Address of the Guest Numbers: G002, G003, G004 and
G005 of the Table Guest.
guestNo
G002
G003
G004
G005

guestName
MHEL
PHOEBE
CEL
GENG

Prepared by: Sir Christopher Lee C. Villablanca

guestAddress
CALIFORNIA
ARIZONA
ALASKA
OHIO

Prelim Project: Theory of Database

j.

Write a code that will show all the results of the four tables namely:
Hotel. Room, Guest, and Booking in a different each execution

Instructions for submission


1. Provide a print screen for each display output
2. All the SQL statement for each output must be readable and visible including
the output table
3. Include the print screen of the four main table together with the output table
4. Save all the print screen in a folder named (LastName_PrelimProject_Section)
5. Follow the sequence format of the print screen below
a. Hotel Table
b. Room Table
c. Booking table
d. Guest Table
e. Chronological order of the expected output table

Prepared by: Sir Christopher Lee C. Villablanca