DELHI PUBLIC SCHOOL
PATNA
Computer Science
Project File
Topic : Hotel Management System
Name :
Roll no. :
Class/Sec :
Admission No. :
1|Page
Academic Year : 2024-25
DELHI PUBLIC SCHOOL PATNA
CERTIFICATE
THIS IS TO CERTIFY THAT …………………………………………
ROLL NO ………. OF CLASS/SEC ………. HAS SUCCESSFULLY
COMPLETED HER COMPUTER SCIENCE PROJECT FILE AS PER
THE CBSE CURRICULUM FOR THE SESSION ……………
PRINCIPAL …………………………
EXTERNAL EXAMINER …………………
INTERNAL EXAMINER ………………..
SCHOOL SEAL
2|Page
DATE:
ACKNOWLEDGMENT
I extend my heartfelt thanks to my Computer Science
teacher, Shadab Sir, for his constant guidance, support, and
valuable suggestions throughout the development of this file.
Their encouragement and constructive feedback helped me
understand key concepts and implement them effectively.
I am also grateful to my school, Delhi Public School Patna,
for providing the necessary resources and a conducive
learning environment to complete this project.
Additionally, I would like to thank my classmates and friends
for their valuable inputs and moral support during
challenging times.
Lastly, I am deeply thankful to my parents and family for
their unwavering support, patience, and encouragement,
which motivated me to complete this project with dedication
and enthusiasm.
3|Page
4|Page
INDEX
S Content Page
NO. No.
1 Certificate
2 Acknowledgement
3 Introduction To
Software And Hardware
4 About the Project
5 Source Code And Output
6 Future Scope
7 Conclusion
8 Bibliography
5|Page
INTRODUCTION
TO SOFTWARE
AND HARDWARE
6|Page
MYSQL
MySQL is a widely used Relational Database Management
System (RDBMS) that allows users to store, manage, and
retrieve data efficiently. It was developed by MySQL AB and
is currently maintained by Oracle Corporation. MySQL is an
open-source software that supports Structured Query
Language (SQL), the standard language for accessing and
manipulating databases.
Key Features of MySQL:
1. Open Source: MySQL is free to use and can be
customized as per user requirements, making it ideal
for a variety of applications.
2. High Performance: It is designed for high-speed data
handling, ensuring quick access and manipulation of
large datasets.
3. Cross-Platform Support: MySQL runs on various
operating systems, including Windows, Linux, macOS,
and UNIX.
4. Security: MySQL provides strong security features like
data encryption, authentication, and access control to
ensure the safety of sensitive data.
5. Scalability: It is capable of handling small-scale
applications as well as large-scale enterprise systems.
7|Page
6. Replication: MySQL supports data replication, which
allows creating backup databases for better reliability
and performance.
7. Integration: It can easily integrate with programming
languages like Python, Java, PHP, and more, making it
versatile for application development.
Applications of MySQL:
1.Web Development: MySQL is often used with PHP to
build dynamic and data-driven websites. Popular
platforms like WordPress and Joomla rely on MySQL.
2.Data Warehousing: It is used for managing and
analyzing large volumes of data.
E-commerce: MySQL supports online shopping
platforms, enabling efficient storage and retrieval of
customer and product data.
Banking Systems: MySQL ensures secure and reliable
management of financial transactions and customer
information.
Social Media Platforms: Large-scale platforms like
Facebook and Twitter use MySQL to manage user data
and interactions.
MySQL is a robust, efficient, and reliable database
management system widely used across industries. Its
versatility and strong performance make it an essential tool
for managing and processing structured data effectively.
8|Page
ABOUT
THE
PROJECT
9|Page
OBJECTIVE
The objective of this project is to create a
Hotel Management System that allows users
to manage hotel rooms, customer bookings,
check-ins, check-outs, and billing. The system
helps in maintaining a record of rooms,
customers, and bookings while also managing
the status of rooms (available or booked).
10 | P a g e
TOOLS
USED
MySQL: To store and manage data related
to customers, rooms, bookings, etc.
XAMPP/WAMP: To run the MySQL server.
11 | P a g e
Notepad++ or any text editor: For writing
SQL queries.
Features
Add new rooms to the hotel.
Register new customers.
Manage room bookings for customers.
Track customer check-ins and check-outs.
12 | P a g e
Generate billing information based on
customer stay.
View all bookings, available rooms, and
customer details.
Delete or update bookings and customer
information.
Database
Design
The project consists of the following tables:
13 | P a g e
1. Rooms Table: Stores information
about rooms in the hotel.
2. Customers Table: Stores information
about the customers.
3. Bookings Table: Manages room
bookings by customers.
4. Staff Table: Stores information about
the hotel staff.
14 | P a g e
SOURCE
CODE
& OUTPUT
15 | P a g e
Table
Design
1) Starting
-- Create the database
CREATE DATABASE HotelManagement;
-- Use the created database
USE HotelManagement;
2)Rooms Table:
CREATE TABLE Rooms (
RoomID INT PRIMARY KEY,
RoomType VARCHAR(50),
Capacity INT,
16 | P a g e
PricePerNight DECIMAL(10, 2),
Status VARCHAR(10) -- 'Available' or 'Booked'
);
3) Customers Table
CREATE TABLE Customers (
CustomerID INT PRIMARY KEY,
Name VARCHAR(100),
Contact VARCHAR(15),
Address VARCHAR(200),
Email VARCHAR(100));
4) Bookings Table
CREATE TABLE Bookings (
BookingID INT PRIMARY KEY,
RoomID INT,
CustomerID INT,
CheckInDate DATE,
CheckOutDate DATE,
17 | P a g e
TotalAmount DECIMAL(10, 2),
Status VARCHAR(10), -- 'Booked', 'Checked-In', 'Checked-Out'
FOREIGN KEY (RoomID) REFERENCES Rooms(RoomID),
FOREIGN KEY (CustomerID) REFERENCES
Customers(CustomerID));
5) Staff Table
CREATE TABLE Staff (
StaffID INT PRIMARY KEY,
Name VARCHAR(100),
Role VARCHAR(50),
Contact VARCHAR(15)
);
6) Payement Table:
CREATE TABLE Payments (
PaymentID INT PRIMARY KEY,
BookingID INT,
PaymentDate DATE,
Amount DECIMAL(10, 2),
PaymentStatus VARCHAR(20), -- e.g., Paid, Pending
FOREIGN KEY (BookingID) REFERENCES
Bookings(BookingID)
18 | P a g e
);
INSERTING DATA
Insert sample data into the tables.
-- Insert rooms into Rooms table
INSERT INTO Rooms (RoomID, RoomType, Capacity,
PricePerNight, Status) VALUES
(101, 'Single', 1, 1000.00, 'Available'),
(102, 'Double', 2, 2000.00, 'Available'),
(103, 'Suite', 3, 3000.00, 'Available');
-- Insert customers into Customers table
INSERT INTO Customers (CustomerID, Name, Contact, Address,
Email) VALUES
19 | P a g e
(201, 'John Doe', '9876543210', '1234 Elm Street, Delhi',
'john@example.com'),
(202, 'Alice Johnson', '9876543211', '56 Rose Garden, Mumbai',
'alice@example.com');
INSERT INTO Customers (CustomerID, Name, Contact, Address,
Email) VALUES
(203, 'Suresh Reddy', '9876543220', '45 Mango Lane, Chennai',
'suresh@example.com'),
(204, 'Pooja Patil', '9876543221', '89 Violet Street, Pune',
'pooja@example.com'),
(205, 'Ravi Kumar', '9876543222', '101 Green Hill, Jaipur',
'ravi@example.com'),
(206, 'Sneha Desai', '9876543223', '76 Oak Road, Surat',
'sneha@example.com'),
(207, 'Akash Mehta', '9876543224', '23 Rose Avenue, Delhi',
'akash@example.com');
-- Insert bookings into Bookings table
INSERT INTO Bookings (BookingID, RoomID, CustomerID,
CheckInDate, CheckOutDate, TotalAmount, Status) VALUES
(301, 101, 201, '2024-12-01', '2024-12-05', 5000.00, 'Booked'),
(302, 102, 202, '2024-12-10', '2024-12-12', 4000.00, 'Booked');
20 | P a g e
(303, 103, 203, '2024-12-15', '2024-12-20', 15000.00,
'Booked'),
(304, 102, 204, '2024-12-18', '2024-12-22', 8000.00, 'Booked'),
(305, 101, 205, '2024-12-25', '2024-12-30', 5000.00, 'Booked'),
(306, 103, 206, '2024-12-28', '2024-12-30', 6000.00, 'Booked'),
(307, 102, 207, '2024-12-12', '2024-12-15', 6000.00, 'Booked');
-- Insert staff into Staff table
INSERT INTO Staff (StaffID, Name, Role, Contact) VALUES
(401, 'Raj Kumar', 'Manager', '9876543213'),
(402, 'Simran Kaur', 'Housekeeping', '9876543214');
(403, 'Anjali Mehta', 'Receptionist', '9876543215'),
(404, 'Vikram Singh', 'Chef', '9876543216'),
(405, 'Priya Sharma', 'Housekeeping', '9876543217'),
(406, 'Rohit Verma', 'Security', '9876543218'),
(407, 'Neha Gupta', 'Manager', '9876543219');
--Insert payments into Payment Table
INSERT INTO Payments (PaymentID, BookingID, PaymentDate,
Amount, PaymentStatus) VALUES
(501, 301, '2024-12-01', 5000.00, 'Paid'),
(502, 302, '2024-12-10', 4000.00, 'Paid'),
21 | P a g e
(503, 303, '2024-12-15', 15000.00, 'Paid'),
(504, 304, '2024-12-18', 8000.00, 'Paid'),
(505, 305, '2024-12-25', 5000.00, 'Paid'),
(506, 306, '2024-12-28', 6000.00, 'Paid'),
(507, 307, '2024-12-12', 6000.00, 'Paid');
RETRIEVING
DATA
1)View All Rooms:
SELECT * FROM Rooms;
22 | P a g e
2)View All Bookings:
SELECT Customers.Name AS CustomerName, Rooms.RoomType,
Bookings.CheckInDate, Bookings.CheckOutDate,
Bookings.Status
FROM Bookings
JOIN Customers ON Bookings.CustomerID =
Customers.CustomerID
JOIN Rooms ON Bookings.RoomID = Rooms.RoomID;
23 | P a g e
3) View All Customers:
SELECT * FROM Customers;
4) View All Staffs:
24 | P a g e
SELECT * FROM Staff;
5) View All Payments:
SELECT
Payments.PaymentID,
Bookings.BookingID,
Payments.PaymentDate,
Payments.Amount,
Payments.PaymentStatus
FROM
25 | P a g e
Payments
JOIN
Bookings ON Payments.BookingID = Bookings.BookingID;
MANIPULATIONS
IN THE SYSTEM
1. Updating Records:
26 | P a g e
You may want to update details like room status, customer
contact, or booking status.
Update Room Status:-
-- Update the status of a room to 'Booked'
UPDATE Rooms
SET Status = 'Booked'
WHERE RoomID = 101;
Update Customer Contacts:
UPDATE Customers
SET Contact = '9876543225'
WHERE CustomerID = 201;
Updating Booking Status:
UPDATE Bookings
SET Status = 'Checked-In'
WHERE BookingID = 301;
2. Deleting Records:
Delete a Booking:
DELETE FROM Bookings
WHERE BookingID = 302;
Delete a Customer:
27 | P a g e
DELETE FROM Customers
WHERE CustomerID = 202;
3. Check-In and Check-Out Process:
Customer Check-In:
When a customer checks in, you need to update their
booking status and the room status.
-- Update the booking status to 'Checked-In' for the
customer
UPDATE Bookings
SET Status = 'Checked-In'
WHERE BookingID = 301;
-- Update the room status to 'Occupied' after check-in
UPDATE Rooms
SET Status = 'Occupied'
WHERE RoomID = 101;
Customer Check-Out:
When a customer checks out, update the booking status to
'Checked-Out' and mark the room as available again.
-- Update the booking status to 'Checked-Out' for the
customer
UPDATE Bookings
SET Status = 'Checked-Out'
WHERE BookingID = 301;
-- Update the room status to 'Available' after check-out
28 | P a g e
UPDATE Rooms
SET Status = 'Available'
WHERE RoomID = 101;
4. Checking Room Availability:
SELECT * FROM Rooms
WHERE Status = 'Available';
5. Adding and Removing Staff:
-- Add a new staff member to the Staff table
INSERT INTO Staff (StaffID, Name, Role, Contact)
VALUES (408, 'Kiran Patel', 'Receptionist', '9876543226');
-- Delete a staff member from the Staff table
DELETE FROM Staff
29 | P a g e
WHERE StaffID = 401;
6. Transaction Management:
If a customer makes a booking and payment at the same time,
ensure both actions are committed together:
-- Start a transaction
START TRANSACTION;
-- Insert a booking record
INSERT INTO Bookings (BookingID, RoomID, CustomerID,
CheckInDate, CheckOutDate, TotalAmount, Status)
VALUES (308, 102, 203, '2024-12-20', '2024-12-25', 12000.00,
'Booked');
-- Insert a payment for the booking
INSERT INTO Payments (PaymentID, BookingID, PaymentDate,
Amount, PaymentStatus)
VALUES (508, 308, '2024-12-20', 12000.00, 'Paid');
-- If both queries succeed, commit the transaction
COMMIT;
-- If any query fails, rollback the transaction
30 | P a g e
-- ROLLBACK;
7) DESCRIBE Rooms;
DESCRIBE Customers;
DESCRIBE Staff;
DESCRIBE Bookings;
DESCRIBE Payments;
31 | P a g e
32 | P a g e
33 | P a g e
FUTURE SCOPES
The hotel management system can evolve into a robust
and scalable solution by integrating advanced
technologies like AI, IoT, and big data analytics. Future
upgrades can help improve operational efficiency,
enhance customer satisfaction, and increase profitability
for hotel businesses.
Integration with Online Platforms: Sync with booking
platforms like Booking.com and Airbnb.
Automation: Implement automated check-in/out and
room management using IoT.
Advanced Analytics: Provide insights on customer
preferences and revenue trends.
Mobile App Support: Develop mobile applications for
customers and staff.
Loyalty Programs: Introduce rewards and discounts for
regular customers.
34 | P a g e
CONCLUSION
In conclusion, the Hotel Management System is a practical and
effective solution for managing hotel operations, ensuring
seamless workflows for staff and memorable experiences for
customers. This project highlights the importance of leveraging
database management systems like MySQL to handle real-
world problems efficiently. The success of this system proves
its potential for implementation in actual hotel businesses,
with ample opportunities for future growth and innovation.
35 | P a g e
BIBLIOGRAPHY
W3Schools SQL Tutorial
GeeksforGeeks - SQL Basics
MySQL Documentation
36 | P a g e
PROJECT EVALUATION
PROFORMA
NAME OF THE SCHOOL :
Group Members :
Teacher’s Remarks :
S.NO. ASPECTS MARKS
OBTAINED
1. Content, Accuracy & Originality
2. Presentation & Creativity
3. Participation, co-operation
4. VIVA
Total marks for project
Date of Submission :
Overall Remarks :
Teacher’s Signature :
Date :
37 | P a g e