You are on page 1of 14

 Introduction to Hotel Management Database Project:

1. Hotel Employee Entity:


▪ This entity represents the hotel staff members who handle various tasks within the
establishment.
▫ Attributes:
- Employee Number: Unique identifier for each employee.
- Employee Name: Name of the employee.
- Date of Birth: Birthdate of the employee.
- Salary: Salary earned by the employee.
- Age: Age of the employee.

2. Customer Entity:
▪ This entity stores information about the hotel's clientele.
▫ Attributes:
- Customer Number: Unique identifier for each customer.
- Customer Name: Name of the customer.
- ID Number: Identification number of the customer.
- Country: Country of origin of the customer.
- Age: Age of the customer.

3. Reservations Entity:
▪ This entity manages room reservations made by customers.
▫ Attributes:
- Room Number: Unique identifier for each hotel room.
- Reservation Date: Date on which the room was reserved.
- Registration Number: Identifier linking the reservation to a specific customer.
- Price: Price associated with the room reservation.
4. Food Entity:
▪ This entity contains information about the food items available in the hotel's
restaurant.
▫ Attributes:
- Code: Unique identifier for each food item.
- Food Name: Name of the food item.
- Price: Price of the food item.

 Motivation for Hotel Management Database Project:

1. Efficient Employee Management:


- Simplifies tracking and managing staff details, schedules, and salaries.
- Enhances organization and task allocation within the hotel.

2. Enhanced Customer Service:


- Stores customer preferences and reservation history for personalized service.
- Increases customer satisfaction and loyalty through tailored experiences.

3. Streamlined Room Reservations:


- Centralizes room availability and guest information for efficient booking processes.
- Reduces errors and enhances coordination between staff and guests.

4. Optimized Resource Management:


- Centralizes data on room occupancy, staff availability, and inventory.
- Enables informed decisions to minimize wastage, maximize efficiency, and reduce costs.

5. Accurate Financial Tracking:


- Tracks financial transactions, including bookings, orders, and salaries.
- Generates detailed reports for monitoring revenue streams and cost-saving opportunities.
 Represents the database as a collection of relations using Relational
model.
1. HotelEmployee Table:

EmployeeNumber EmployeeName DateOfBirth Salary Age

1 John Smith 1980-05-15 5000 41

2 Mary Johnson 1985-09-20 4500 36

3 David Lee 1978-12-10 5500 43

4 Sarah Brown 1990-03-25 4800 32

5 Ahmed Khan 1983-06-28 5200 38

2. Customer Table:

CustomerNumber CustomerName IDNumber Country Age

1 Alice Brown 1234567890 USA 25

2 Bob Lee 0987654321 Canada 30

3 Emily Wang 5678901234 China 28

4 Carlos Gomez 3456789012 Spain 35

5 Maria Silva 7890123456 Brazil 40


3. Reservations Table:

RoomNumber ReservationDate RegistrationNumber Price

101 2024-04-20 1 100

102 2024-04-21 2 120

201 2024-04-22 3 150

202 2024-04-23 4 130

301 2024-04-24 5 110

4. Food Table:

Code FoodName Price

1 Burger 10

2 Pizza 12

3 Salad 8

4 Pasta 15

5 Steak 20
 ERD
 Mapping technique
 Normalization
1. HotelEmployee Table:

EmployeeNumber EmployeeName DateOfBirth Salary Age

1 John Smith 1980-05-15 5000 41

2 Mary Johnson 1985-09-20 4500 36

3 David Lee 1978-12-10 5500 43

4 Sarah Brown 1990-03-25 4800 32

5 Ahmed Khan 1983-06-28 5200 38

1st Normal Form (1NF):


The HotelEmployee table is already in 1NF since each attribute contains atomic values and
there are no repeating groups.

2nd Normal Form (2NF):


There are no partial dependencies in the HotelEmployee table, so it already meets the
requirements of 2NF.

3rd Normal Form (3NF):


To achieve 3NF, we need to identify and eliminate any transitive dependencies.

▪ EmployeeInfo Table:

EmployeeNumber Salary
1 5000

2 4500

3 5500

4 4800

5 5200
▪ HotelEmployee Table:

EmployeeNumber EmployeeName DateOfBirth Age

1 John Smith 1980-05-15 41

2 Mary Johnson 1985-09-20 36

3 David Lee 1978-12-10 43

4 Sarah Brown 1990-03-25 32

5 Ahmed Khan 1983-06-28 38

2. Customer Table:

CustomerNumber CustomerName IDNumber Country Age

1 Alice Brown 1234567890 USA 25

2 Bob Lee 0987654321 Canada 30

3 Emily Wang 5678901234 China 28

4 Carlos Gomez 3456789012 Spain 35

5 Maria Silva 7890123456 Brazil 40


▪ CustomerInfo Table:

CustomerNumber CustomerName IDNumber

1 Alice Brown 1234567890

2 Bob Lee 0987654321

3 Emily Wang 5678901234

4 Carlos Gomez 3456789012

5 Maria Silva 7890123456

▪ CustomerDetails Table:

CustomerNumber Country Age

1 USA 25

2 Canada 30

3 China 28

4 Spain 35

5 Brazil 40
 Normalization
▪ CREATE TABLE EmployeeInfo (
EmployeeNumber INT PRIMARY KEY,
Salary DECIMAL(10, 2)
);

▪ CREATE TABLE HotelEmployee (


EmployeeNumber INT PRIMARY KEY,
EmployeeName VARCHAR(255),
DateOfBirth DATE,
Age INT,
FOREIGN KEY (EmployeeNumber) REFERENCES
EmployeeInfo(EmployeeNumber)
);

▪ CREATE TABLE CustomerInfo (


CustomerNumber INT PRIMARY KEY,
CustomerName VARCHAR(255),
IDNumber VARCHAR(20)
);

▪ CREATE TABLE CustomerDetails (


CustomerNumber INT PRIMARY KEY,
Country VARCHAR(100),
Age INT,
FOREIGN KEY (CustomerNumber) REFERENCES
CustomerInfo(CustomerNumber)
);
▪ Insert data into tables
▫ INSERT INTO EmployeeInfo (EmployeeNumber, Salary) VALUES
(1, 5000.00),
(2, 4500.00),
(3, 5500.00),
(4, 4800.00),
(5, 5200.00);

▫ INSERT INTO HotelEmployee (EmployeeNumber, EmployeeName, DateOfBirth, Age)


VALUES
(1, 'John Smith', '1980-05-15', 41),
(2, 'Mary Johnson', '1985-09-20', 36),
(3, 'David Lee', '1978-12-10', 43),
(4, 'Sarah Brown', '1990-03-25', 32),
(5, 'Ahmed Khan', '1983-06-28', 38);

▫ INSERT INTO CustomerInfo (CustomerNumber, CustomerName, IDNumber) VALUES


(1, 'Alice Brown', '1234567890'),
(2, 'Bob Lee', '0987654321'),
(3, 'Emily Wang', '5678901234'),
(4, 'Carlos Gomez', '3456789012'),
(5, 'Maria Silva', '7890123456');

▫ INSERT INTO CustomerDetails (CustomerNumber, Country, Age) VALUES


(1, 'USA', 25),
(2, 'Canada', 30),
(3, 'China', 28),
(4, 'Spain', 35),
(5, 'Brazil', 40);
Q1. Retrieve all employees' information

SELECT *
FROM HotelEmployee;
Query 2: Retrieve all customers' information:

SELECT*
FROM CustomerDetails;
Query 3: Retrieve the total number of employees:

SELECT COUNT(*) AS TotalEmployees


FROM HotelEmployee;

You might also like