You are on page 1of 4

Based on the HELP TRAVEL case study, you are required to:

A. Identify the information required for each section in the case study:
1. IDENTIFY ENTITIES
 SECTION A: ATTRACTION, PACKAGE, TRAVELER
 SECTION B: HOTEL, ATTRACTION, ROOM_TYPE, BOOKING

2. IDENTIFY ATTRIBUTES
SECTION A:
 ATTRACTION.: AttractionID, AttractionName, Description, TicketPrice
 PACKAGE: PackageNumber, TravellingFromDate, TravellingToDAte,
PackageCreatedBy, PassportNumber
 TRAVELER: PassportNo, Name

SECTION B:
 HOTEL: HotelNumber, HotelName
 ATTRACTION: AttractionID, AttractionName
 ROOM_TYPE: RoomTypeName, Sleeps, Price
 BOOKING: PackageNumber, HotelNum, CheckIn, CheckOut, RoomType,
NumberOfRooms

3. IDENTIFY FUNCTIONAL DEPENDENCIES


SECTION A

 AttractionID  AttractionName, Description, TicketPrice (partial) (Attraction)


 PackageNumber  TravellingFromDate, TravellingToDate, PackageCreatedBy,
PassportNo (partial) (Package)
 AttractionID  AttractionName (transitive) (Attraction)
 PackageNumber, AttractionID  NumberOfTickets (partial) TicketAttraction

SECTION B

 HotelNumber  HotelName (partial) Hotel


 AttractionID  AttractionName (transitive) Attraction
 HotelNumber, RoomType  sleeps, price (partial) Room
 PackageNumber, HotelNum, CheckInDate, CheckOutDate, RoomType 
NumberOfRooms (partial) Booking
4. IDENTIFY RELATIONSHIP AND CARDINALITIES
SECTION A
 1 TRAVELER creates 1/M PACKAGES, 1 PACKAGE created-by1
TRAVELER
 1 PACKAGE purchaseTicketFor 0/M ATTRACTIONS, 1 ATTRACTION
purchased-by 0/M PACKAGES

SECTION B
 1 PACKAGE includes 0/M BOOKING, 1 BOOKING included-in 1 PACKAGE
 1 BOOKING for 1/M ROOM_TYPES, 1 ROOM_TYPE for 1 BOOKING
 1 ROOM_TYPE located-at 1 HOTEL, 1 HOTEL has 1/M ROOM_TYPES
 1 HOTEL is-near-to 0/M ATTRACTIONS, 1 ATTRACTION is-near-to 0/M
HOTELS

5. List any assumptions that you make.


 1 room type can be booked once at a time.

B. Develop the Entity Relationship Diagram (ERD) in 3NF using crows’ foot notation for
cardinalities. You must show the entities, composite entities, relationships, cardinalities and
any optionality. Please use DIA software to construct your ERD.

Initial ERD (for reference only):

Note: There are two (2) M-N relationships: convert to composite entities.
Final ERD in 3NF

C. Develop the Relational Data Model (RDM) which corresponds to the ERD. That is, the set
of tables in third normal form that could be used to represent the whole of this data model.
Your RDM should identify primary and foreign keys. Your RDM should be presented in the
format:

TABLENAME (attribute1, attribute2, attribute3, …)


PRIMARY KEY attribute1
FOREIGN KEY attribute3 REFERENCES table name

Sample of the Attraction table:

Attraction (AttractionID, AttractionName, Description, TIcketPrice)


PK: AttractionID
FK: none

TicketPurchase (AttractionID, PackageNumber, NumberOfTickets)


PK: AttractionID, PackageNumber
FK: AttractionID references Attraction (AttractionID)
PackageNumber references Package (PackageNumber)

HotelAttraction (HotelNumber, AttractionID)


PK: HotelNumber, AttractionID
FK: AttractionID references Attraction (AttractionID)
HotelNumber references Hotel (HotelNumber)

Notes for composite entity:


- Take the PK of tables from both sides and assign as PK and FK.
- For some cases, there might be other attributes to be stored and assigned as PKs.

Self-exercise, please complete this part


D. Physical Database Design:

Develop the Physical database design and implement it using MySQL Workbench DBMS.
You are required to insert at least 10 dummy records for each table.

Sample of the Attraction and Hotel tables:

Physical Table Definitions


Table Column Data Type Notes
Attraction AttractionID VARCHAR(10) Primary Key NOT NULL
AttractionName VARCHAR(50) NOT NULL
Description VARCHAR(50)
TicketPrice DECIMAL(6,2)
HotelNo VARCHAR(15) Primary Key NOT NULL
Hotel
HotelName VARCHAR(40) NOT NULL

Implementation in the MySQL Workbench: (sample of Attraction table)


#-----------Creating Table--------------#
CREATE TABLE attraction
(
AttractionID VARCHAR(10) NOT NULL PRIMARY KEY,
AttractionName VARCHAR(50 NOT NULL),
Description VARCHAR(50),
TicketPrice DECIMAL(6,2));

#---------Inserting Records (sample for two records-----------#


INSERT INTO attraction VALUES (‘A02’, ‘Minion Rushland’, A sport
facility that incorporates climbing’, 20);
INSERT INTO attraction VALUES (‘A03’, ‘Candyland’, ‘Candy based theme
park, 150);

Note:
For SQL queries, in your report please use font size: 10, font style: Courier New,
Single spacing.

Results (Provide the screenshot from Workbench) – Sample of Attraction table:

You might also like