University of Prince Mugrin (UPM)
CS351_ Database systems
Spring-2024-2025
Project’s Report
Hotel Management System
done by:
Osama Muammar Mohammed 4312647
Omar Abdullah Aljoud 4220041
Abdulmajid Shaker 4312716
Abdulaziz Khalifa Almuteri 4211811
Instructor:
Dr. Mohammed AL-Qadhi
1
Table of Contents
1- Introduction
1.1 Problem Statement
1.2 Objectives
1.3 Scope
1.4 Timeline and milestones
2- Requirement analysis
2.1 Functional requirements
2.2 User requirements
3-Conceptual design
3.1 Entity-Relationship Diagram
3.2 Entity Description
3.3 Relationships
4-Logical Design
4.1 Relational schema
4.2 Normalization
4.3 Constrains
5-Implementation
5.1 System Interface Development
5.2 Database Creation and Data Population
5.3 Query Development and Data Manipulation
6-Testing and Validation
6.1 Testing Scenarios and Validation Results
7-Conclusion
7.1 summary of the project
Appendix
2
1- Introduction
1.1 Introduction and problem description
In this course project we decided to build a hotel management system. Our goal is to
create an efficient system and improve the overall guest experience. The system should
work on booking rooms for the guest, booking cancellations (overall rooms
management) , staff management, store the client’s information for future use, hotel
restaurant, and events management ( e.g. spa and swimming pool ).
1.2 Objectives
Functional requirements
1.2.1 The system must allow guests to book rooms by selecting room
types, checking availability, and providing check-in and check-
out dates.
1.2.2 The system must store guest details, including name, phone number,
email, and nationality.
1.2.3 The system must track hotel staff information, including unique IDs,
names, positions, salaries, and contact details.
1.2.4 The system must enable guests to book additional services such as
spa treatments and event hosting. It should record service details,
including prices and availability, as well as track appointment details
and payment statuses.
Non-Functional requirements:
1- The system should handle up to 500 simultaneous users without
degradation in performance, ensuring quick response times for booking and
management operations.
2- The system must implement strong security measures to protect guest
information, including encryption of sensitive data and role-based access
controls for staff management.
3- The user interface should be intuitive and accessible, allowing guests and
staff to navigate the system easily.
4- The system must be designed to accommodate future growth, by adding
new rooms, services, or staff, without requiring significant rework or
downtime.
1.3 Scope
Creating a Hotel Management System involves multiple components that handle
various aspects of hotel operations, from reservations to guest experience.
Here is a detailed scope for your project, structured into modules:
1. Reservation Management:
• Room booking (online/offline).
• Availability calendar.
• Rate management (seasonal pricing, promotions).
• Group booking.
3
2. Front Desk Operations:
• Guest check-in/check-out.
• ID verification.
• Room assignment.
• Early check-in/late check-out processing.
3. Guest Management:
• Guest profiles (history).
• Loyalty program management.
• Communication system (email/SMS, notifications).
• Feedback and rating system.
4. Room Management:
• Room type (single, double, suite, etc.).
• Room status tracking (available, occupied, under maintenance).
• Housekeeping schedules and tracking.
5. Billing and Payment:
• Invoice generation.
• Payment options (credit card, cash).
6. Inventory and Maintenance:
• Track hotel assets.
• Maintenance request logging and tracking.
• Supplier management.
7. Reporting and Analytics:
• Occupancy reports.
• Revenue reports.
• Guest trends.
• Performance dashboards for management.
8. Admin Panel:
• Staff and role management (access control).
• System settings and configuration.
• Hotel profile and information settings.
• Data backup and restore options.
4
1.4Timeline and milestone
• Week 1: Project Proposal Define the problem and project objectives Identify system
requirements and core functionalities
• Week 2: System Design the database structure Define system architecture and user
interface
• Weeks 3-4: System Development Implement core functionalities such as booking
and user management Integrate the frontend with the database
• Week 5: System Testing Test all features to ensure they function correctly Fix bugs
and improve system performance
• Week 6: Finalization and Submission Prepare the final report and presentation
Present and submit the project
2- Requirement analysis
2.1 Functional requirements
A) System Requirements
1. Arrival Date.
2. Total Stay nights.
3. Arrival times/ Flight details.
4. Total people.
5. Room type.
6. Room preference (Smoking/No smoking, Higher floor, Pool view or away
from elevator).
7. Photo ID during check in time is compulsory for all adult.
8. Photo ID, your Passport, Citizenship ID card or Driving License.
B) Functional Requirements:
1. Every online booking needs to be associated with an account.
2. One account cannot be associated with multiple users.
3. Search results should enable users to find the most recent and relevant booking
options.
4. System should enable users to book / pay for their tickets only in a timeboxed
manner after tickets being added to the cart.
5. System should only allow users to move to payment only when mandatory fields
such as date, time, location has been mentioned.
6. Use of captcha and encryption to avoid bots from booking tickets.
7. User should be helped appropriately to fill in the mandatory fields, in case of
invalid input.
8. System should accept payments via different payment methods, like PayPal,
wallets, cards.
9. System should visually confirm as well as send booking confirmation to the user's
contact.
2.2 User requirement
5
Rooms & Bookings:
The hotel consists of multiple rooms, each identified by a room number. Rooms have
different types (single, double, suite), prices per night, and availability statuses. Guests
can book rooms, with each booking assigned a unique ID and linked to check-in and
check-out dates. The system also handles booking cancellations, storing the
cancellation date and refund status.
Guests:
Guest information, including name, phone number, email, and nationality, is stored for
identification and future bookings. Returning guests may receive loyalty benefits based
on previous stays.
Staff Management:
The system tracks hotel staff, including receptionists, housekeeping, and managers,
each identified by a unique ID. Staff details such as name, position, salary, and contact
information are recorded. Housekeeping staff are assigned to specific floors, while
receptionists manage guest check-ins and check-outs.
6
Hotel Restaurant:
The hotel restaurant serves meals, each with name, price, and availability status.
Guests can place orders, which are linked to their room bill or paid separately. The
system tracks order details, payment status, and dining preferences.
Events & Services:
The hotel offers services such as spa treatments, swimming pool access, and event
hosting. Each service has a name, price, and availability schedule. Guests can book
services, and the system records appointment details and payment status.
3-Conceptual design
3.1 ERD
7
In this ER diagram, I designed a hotel management system based on the project
requirements. I included main entities like Guest, Room, Booking, Staff, Meal, Order,
Service, and Appointment, with their needed attributes. I drew the relationships between
them, like a guest can make multiple bookings, orders, or appointments. I did not add
any relationships for Staff since there was no clear connection mentioned in the
requirements. I used 1:N relationships based on what is written in the document.
3.2 Entity Description
Guest
Represents a customer; includes Name, Email, Phone, and Nationality.
Booking
Represents a reservation; includes CheckIn/Out Dates, RoomNumber, etc.
Room
Describes hotel rooms with Type, PricePerNight, and AvailabilityStatus.
Staff
Represents hotel staff with details like Role, Salary, AssignedFloor.
Invoice
Financial record tied to a booking; including TotalAmount and PaymentMethod.
Order
Meal order placed by a guest; includes PaymentStatus and DiningPreference.
Meal
Meal options provided; includes Name, Price, and AvailabilityStatus.
Appointment
Service appointment for a guest; includes DateTime and PaymentStatus.
Service
Services offered by the hotel; include Name, Price, and Schedule.
3.3 Relationships
Guest and Appointment (1:N)
A guest can book multiple appointments.
Guest and Booking (1:N)
A guest can make multiple bookings.
Booking and Room (M:N)
A booking can include multiple rooms.
Staff and Room (M:N)
A staff member can clean multiple rooms.
Booking and Invoice (1:1)
Each booking is linked to one invoice only.
Order and Meal (1:N)
An order includes one meal.
Guest and Order (1:N)
A guest can place multiple meal orders.
Service and Appointment (1:N)
A service can be scheduled in multiple appointments.
8
4-Logical Design
4.1 Relational schema
In this relational schema model. I have identified all the regular entities and
created tables for them, making sure to include their primary attributes and
keys. Next, I checked the relationships to determine which ones are 1:N
and added the appropriate foreign keys to the "multiple" side of each
relationship. I created arrows that illustrate each 1:1 relationship, I created
arrows that show each M:N relationship and converted the relationships to
a table, I also checked if there were any weak entities, or multivalued
attributes. Finally, I created an arrow showing each relationship 1:N, and
9
whether the relationship is already displayed in the diagram or needs to be
added manually.
1. Appointment → Guest
2. Booking → Guest
3. Order → Guest
4. Order → Meal
5. Appointment → Service
6. Booking → Room
7. OrderMeal → Meal
8. OrderMeal → Order
9. Invoice → Booking
10.OrderMeal → Meal
11.Cleans → Room
12.Cleans → Staff
4.2 Normalization
No submission (look at contribution table in the last page)
4.3 Constrains
Primary Key Foreign Key
Table Name Related to table
(PK) (FK)
InvoiceID - -
Invoice
- BookingID Booking
Guest GuestID - -
Room RoomNamber - -
Staff StaffID - -
Service ServiceID - -
Meal MealID - -
AppointmentID - -
Appointment - GuestID Guest
- ServiceID Service
BookingID - -
Booking
- GuestID Guest
OrderID - -
Order - GuestID Guest
- MaelID Meal
- RoomNumber Room
Clean
- StaffID Staff
5-Implementation
5.1 System Interface Development
In this part we connect our SQL to a python-based system interface in
10
visual studio programming application so now we can insert, update, and
delete from our database using this system interface.
5.2 Database Creation and Data Population
create database Hotel;
use Hotel;
CREATE TABLE Guest (
GuestID INT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Email VARCHAR(100) UNIQUE NOT NULL,
Phone VARCHAR(15),
Nationality VARCHAR(50)
);
CREATE TABLE Room (
RoomNumber INT PRIMARY KEY,
Type VARCHAR(50),
AvailabilityStatus VARCHAR(20) DEFAULT 'Available',
PricePerNight DECIMAL(10,2) NOT NULL CHECK (PricePerNight > 0)
);
CREATE TABLE Booking (
BookingID INT PRIMARY KEY,
GuestID INT,
RoomNumber INT,
CheckInDate DATE NOT NULL,
CheckOutDate DATE NOT NULL,
CancellationDate DATE,
RefundStatus VARCHAR(20),
FOREIGN KEY (GuestID) REFERENCES Guest(GuestID),
FOREIGN KEY (RoomNumber) REFERENCES Room(RoomNumber)
);
CREATE TABLE Staff (
StaffID INT PRIMARY KEY,
11
Name VARCHAR(100) NOT NULL,
Email VARCHAR(100) UNIQUE NOT NULL,
Password VARCHAR(100) NOT NULL,
Role VARCHAR(50),
Position VARCHAR(50),
Salary DECIMAL(10,2) CHECK (Salary >= 0),
ContactInfo VARCHAR(100),
AssignedFloor INT
);
CREATE TABLE Service (
ServiceID INT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Price DECIMAL(10,2) NULL,
AvailabilitySchedule VARCHAR(100)
);
CREATE TABLE Appointment (
AppointmentID INT PRIMARY KEY,
GuestID INT,
ServiceID INT,
AppointmentDateTime DATETIME NOT NULL,
PaymentStatus VARCHAR(20),
FOREIGN KEY (GuestID) REFERENCES Guest(GuestID),
FOREIGN KEY (ServiceID) REFERENCES Service(ServiceID)
);
CREATE TABLE Meal (
MealID INT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Price DECIMAL(10,2) NOT NULL CHECK (Price >= 0),
AvailabilityStatus VARCHAR(20)
);
CREATE TABLE `Order` (
OrderID INT PRIMARY KEY,
GuestID INT,
PaymentStatus VARCHAR(20),
DiningPreference VARCHAR(50),
FOREIGN KEY (GuestID) REFERENCES Guest(GuestID)
);
CREATE TABLE OrderMeal (
OrderID INT,
MealID INT,
PRIMARY KEY (OrderID, MealID),
FOREIGN KEY (OrderID) REFERENCES `Order`(OrderID),
FOREIGN KEY (MealID) REFERENCES Meal(MealID)
);
CREATE TABLE Invoice (
InvoiceID INT PRIMARY KEY,
BookingID INT,
IssueDate DATE,
PaymentMethod VARCHAR(50),
TotalAmount DECIMAL(10,2),
FOREIGN KEY (BookingID) REFERENCES Booking(BookingID)
);
CREATE TABLE RoomCleaning (
12
StaffID INT,
RoomNumber INT,
PRIMARY KEY (StaffID, RoomNumber),
FOREIGN KEY (StaffID) REFERENCES Staff(StaffID),
FOREIGN KEY (RoomNumber) REFERENCES Room(RoomNumber)
);
INSERT INTO Guest (GuestID, Name, Email, Phone, Nationality)
VALUES
(1, 'Ahmed mohammed', '
[email protected]', '0501234567', 'Saudi'),
(2, 'Layan Khaled', '
[email protected]', '0569876543', 'Saudi'),
(3, 'khaled Saeed', '
[email protected]', '0534567890', 'Saudi');
INSERT INTO Staff (StaffID, Name, Email, Password, Role, Position, Salary, ContactInfo,
AssignedFloor)
VALUES
(1, 'Noura Mohammed', '[email protected]', 'A1234565', 'Reception', 'Receptionist', 5000.00,
'0551122334', 1),
(2, 'Mohammed Ali', '[email protected]', 'BW11233', 'Cleanliess', 'Janitor', 3000.00,
'0542233445', 2),
(3, 'Ali Ahmed', '[email protected]', 'ABBt43223', 'Management', 'Hotel Manager', 10000.00,
'0533344556', NULL);
INSERT INTO Room (RoomNumber, Type, AvailabilityStatus, PricePerNight)
VALUES
(101, 'double', 'Available', 350.00),
(102, 'Single', 'Occupied', 250.00),
(201, 'Wing', 'Available', 800.00);
INSERT INTO Booking (BookingID, GuestID, RoomNumber, CheckInDate, CheckOutDate,
CancellationDate, RefundStatus)
VALUES
(1, 1, 101, '2025-05-01', '2025-05-05', NULL, 'No Refund'),
(2, 2, 102, '2025-05-03', '2025-05-06', NULL, 'Refundable'),
(3, 3, 201, '2025-05-10', '2025-05-15', NULL, 'No Refund');
INSERT INTO Service (ServiceID, Name, Price, AvailabilitySchedule)
VALUES
(1, 'Room cleaning', NULL, 'Daily'),
(2, 'Laundry Service', 5.00, 'Daily from 8AM to 10PM'),
(3, 'Food delivery service', NULL, '24 Hours');
INSERT INTO Appointment (AppointmentID, GuestID, ServiceID, AppointmentDateTime,
PaymentStatus)
VALUES
(1, 1, 1, '2025-05-02 10:00:00', 'paid'),
(2, 2, 2, '2025-05-04 11:30:00', 'unpaid'),
(3, 3, 3, '2025-05-11 13:00:00', 'paid');
INSERT INTO Meal (MealID, Name, Price, AvailabilityStatus)
VALUES
(1, 'Chicken Kabsa', 45.00, 'Available'),
(2, 'Chicken Mandi', 60.00, 'Available'),
(3, 'Fattoush salad', 20.00, 'Available');
INSERT INTO `Order` (OrderID, GuestID, PaymentStatus, DiningPreference)
VALUES
(1, 1, 'paid', 'Inside The room'),
(2, 2, 'unpaid', 'Inside The restaurant'),
13
(3, 3, 'paid', 'Inside The room');
INSERT INTO OrderMeal (OrderID, MealID)
VALUES
(1, 1),
(1, 3),
(2, 2),
(3, 1),
(3, 2);
INSERT INTO Invoice (InvoiceID, BookingID, IssueDate, PaymentMethod, TotalAmount)
VALUES
(1, 1, '2025-05-01', 'Apple pay', 1400.00),
(2, 2, '2025-05-03', 'cash', 750.00),
(3, 3, '2025-05-10', 'Bank transfer', 4000.00);
INSERT INTO RoomCleaning (StaffID, RoomNumber)
VALUES
(2, 101),
(2, 102),
(2, 201);
5.3 Query Development and Data Manipulation
-- Guest
SELECT * FROM Guest;
SELECT * FROM Guest WHERE Nationality = 'Saudi';
SELECT * FROM Guest WHERE Email LIKE '%gmail.com';
SELECT * FROM Guest ORDER BY Name ASC;
SELECT DISTINCT Nationality FROM Guest;
SELECT COUNT(*) FROM Guest;
SELECT COUNT(DISTINCT Nationality) FROM Guest;
-- Room
SELECT * FROM Room;
SELECT * FROM Room WHERE Type = 'Suite';
SELECT * FROM Room WHERE PricePerNight BETWEEN 200 AND 500;
SELECT * FROM Room ORDER BY PricePerNight DESC;
SELECT * FROM Room WHERE AvailabilityStatus IS NOT NULL;
SELECT AVG(PricePerNight) FROM Room;
SELECT MAX(PricePerNight) FROM Room;
-- join
SELECT Guest.Name, Room.Type, Booking.CheckInDate
FROM Booking
INNER JOIN Guest ON Booking.GuestID = Guest.GuestID
INNER JOIN Room ON Booking.RoomNumber = Room.RoomNumber;
-- view
CREATE VIEW AvailableRooms AS
SELECT RoomNumber, Type, PricePerNight
14
FROM Room
WHERE AvailabilityStatus = 'Available';
-- group by
SELECT Nationality, COUNT(*) AS GuestCount
FROM Guest
GROUP BY Nationality
HAVING COUNT(*) > 1;
-- trigger
CREATE TRIGGER update_room_availability
AFTER INSERT ON Booking
FOR EACH ROW
UPDATE Room
SET AvailabilityStatus = 'Booked'
WHERE RoomNumber = NEW.RoomNumber;
6-Testing and Validation
6.1 Testing Scenarios and Validation Results
Inserting a new tuple:
If we insert a new Guest with ID 4 and Name Osama it will automatically
be inserted into the database.
Updating a tuple:
When we update the same tuple we inserted before to let the name be
15
Mohammed with phone number 0555555555it will be updated.
Deleting a tuple:
If we tried to delete a row that is being referenced in another relation we
will be asked if we would like to skip the FK constrains or not, if we did
not skip it so an error message will appear
16
But if we agree to skip that constraints the tuple will be successfully deleted
7-Conclusion
7.1 summary of the project
Our project involved creating a hotel management system that helps manage room
bookings, guest information staff details and other thing we mention them above in
details we implemented this project using MySQL and python for the system interface.
In this project we gained many new knowledge and skills such as requirements analysis,
17
build a basic system interface using python, and finally learned how to work as a team.
We also implemented the skills we gain from the course during the semester such as
conceptual and logical design.
Appendix
Table of Contribution
Task Done By:
1.1-Introduction and problem description Osama
2.2- user requirements
5.1 System Interface Development
6.1 Testing Scenarios and Validation Results
7.1 summary of the project
The overall report design
1.2- Objectives Abdulmajid
4.1-Relational schema
5.2 Database Creation and Data Population
1.3-Scope Abdulaziz
2.1- functional requirements
4.2 Normalization
4.3 Constrains
1.4-Timeline and milestones Omar
3.1 ER model
3.2 Entity description
3.3 Relationships
5.3Query Development and Data Manipulation
Minutes’ meeting
Online workshops, no estimated time.
18