S. D.
Adarsh Vidyalaya
SECTOR-47, SOHNA ROAD, GURUGRAM
A PROJECT REPORT
ON
“STUDENT MANAGEMENT SYSTEM”
FOR
AISSCE: 2023-24
[AS A PART OF THE COMPUTER SCIENCE (083)]
SUBMITTED BY:
Student’s Name: Omkarita singh
Board Roll No.:
UNDER THE GUIDANCE OF:
MS. HARSHA MONGA
PGT COMPUTER SCIENCE
CERTIFICATE
I hereby certify that the Project/Dissertation
titled "Student Management System,"
completed by Omkarita Singh in Class XII for
the academic session 2023-24, is an original
work. It was conducted under my direct
supervision and guidance for the partial
fulfillment of CBSE Board Examination 2023-24.
To the best of my knowledge, no part of this
work has been submitted for any other
examination, and it is not a component of any
other course undergone by the candidate.
.…………………… …………………….
Internal Teacher External Teacher
….……….…………………
Signature of Principal
ACKNOWLEDGEMENT
I conducted this Project as part of my XII-Computer Science
course, utilizing my knowledge and experiences gained
through study and class work. Developing a software system
is intricate and time-consuming, demanding systematic
study, insightful vision, and a professional approach to
design and development. Throughout this process, the
support, guidance, and well-wishes of experienced
individuals become invaluable.
I express my sincere thanks to my teacher, Ms. Harsha
Monga, for her guidance and support. I am grateful to our
Principal, Ms. Kalpna Kashyap, for dedicating valuable time
and providing moral support during the development of this
software.
Special appreciation goes to my friends whose valuable
suggestions significantly contributed to the success of this
project.
Omkarita singh
Class XII
Table of Contents
Sno. Description Page no.
1. Preface 1
2. Introduction 2
3. Objective 3
4. Problem Definition and Analysis 4
5. System Requirements 5
6. System Design and Development 6-8
7. Source Code 9-15
8. Output 16-20
9. Reference 21
1. Preface
In today's digital age, numerous industries are embracing automation for
streamlined operations. One such industry is hospitality, where manual
processes often persist. During my recent stays at various hotels, I noticed the
reliance on manual methods, especially in managing guest information and
room allocations.
Inspired by this observation, I proposed the development of a Hotel
Management System for our practical evaluation. Upon discussing this idea
with my team, we unanimously agreed to embark on this project. After
consulting our instructor, we committed to building a menu-driven program
using Python with MySQL connectivity.
Our objective is clear:
AIM: To create a software solution that offers insights into the operational
intricacies of hotel management, focusing on guest information, room
allocations, and database management.
Title: Hotel Management System
Problem Definition: Crafting a software system to delve into the inner
workings of hotel management, emphasizing database handling and guest-
related functionalities.
Driven by this goal, our team initiated the project, aiming to develop a
comprehensive software system that sheds light on the management of guest
data, room allocations, and the hotel's database operations.
2. Introduction
In today’s technologically driven world, numerous operations are digitized for
efficiency. Hotel management often involves considerable paperwork.
To streamline hotel operations, a dedicated software system proves invaluable.
This software simplifies the registration process by capturing essential guest
information, including:
Guest ID or booking reference
Guest name
Arrival/departure dates
Contact details
Room preferences
Special requirements or requests
Traditionally, guests would need to call or visit the hotel's front desk to make
reservations. However, this software empowers guests to effortlessly book
rooms online, specifying dates, room preferences, and obtaining a unique
booking reference.
As a result, this software significantly eases the workload for both guests and
hotel management. It simplifies the reservation process, providing guests with
a seamless booking experience while allowing hotel staff to efficiently manage
room allocations and guest preferences.
This adaptation aligns the functionalities and benefits of a Hotel Management
System, focusing on guest information capture, reservation ease, and improved
efficiency for both guests and hotel staff.
3. Objective
The primary objectives of the Hotel Management System are:
Enhance guest experience and satisfaction.
Optimize operational costs within the hotel.
Offer on-demand Management Information System (MIS) reports to facilitate
informed decision-making.
Foster seamless coordination among various hotel departments.
Provide centralized control for top management.
This system caters to critical activities within a hotel environment:
Front Desk Management for check-ins, check-outs, and guest inquiries.
Guest Management including reservations, registrations, and preferences.
Departmental Modules for room service, housekeeping, and facilities
management.
Billing and Payment Processing for guest services and amenities.
Inventory and Procurement Management for hotel supplies and resources.
Financial Accounting covering billing, inventory, accounts, and payroll.
Developed using Python and MySQL, the Hotel Management System follows
a structured approach similar to a linear and sequential model. Each phase of
development targets specific goals, ensuring a systematic progression. Once a
development phase is completed, the process moves forward without revisiting
previous stages. This model's advantage lies in its ability to compartmentalize
tasks and maintain managerial oversight throughout the development lifecycle.
4. Use of Technology
1. MYSQL
MySQL is a relational DBMS that can run virtually all platforms, including
Linux, Unix and Windows.
Popular for web-based applications and online publishing, MySQL is a part
of open-source enterprise stack LAMP (Linux, Apache, MySQL, PHP).
MySQL is a freely available open source RDBMS that uses Structured
Query Language (SQL). It is down-loadable from site www.mysql.org.
MySQL is fast, reliable, scalable alternative to many of the commercial
RDBMs available today. MySQL provides you with a rich set of features
that support a secure environment for storing, maintaining, and accessing
data.
MySQL was created and supported by MySQL AB, a company based in
Sweden. This company is now a subsidiary of Sun Microsystems, which
holds the copyright to most of the codebase. On April 20th, 2009 Oracle
Corp., which develops and sells the proprietary Oracle database,
announced a deal to acquire Sun Microsystems.
SQL provides many different types of commands used for different
purposes. SQL commands can be divided into following categories:
i. Data Definition Language (DDL)
ii. Data Manipulation Language (DML)
iii. Transaction Control Language (TCL)
iv. Session Control Commands
v. System Control Commands
2. Python
Python is an interpreted, object-oriented, high-level programming
language with dynamic semantics. Its high-level built in data structures,
combined with dynamic typing and dynamic binding; make it very attractive
for Rapid Application Development, as well as for use as a scripting or glue
language to connect existing components together.
Python's simple, easy to learn syntax emphasizes readability and therefore
reduces the cost of program maintenance. Python supports modules and
packages, which encourages program modularity and code reuse.
The Python interpreter and the extensive standard library are available in
source or binary form without charge for all major platforms, and can be
freely distributed.
Often, programmers fall in love with Python because of the increased
productivity it provides. Debugging Python programs is easy: a bug or bad
input will never cause a segmentation fault. Instead, when the interpreter
discovers an error, it raises an exception.
A source level debugger allows inspection of local and global variables,
evaluation of arbitrary expressions, setting breakpoints, stepping through
the code a line at a time, and so on.
The debugger is written in Python itself, testifying to Python's introspective
power. On the other hand, often the quickest way to debug a program is to
add a few print statements to the source: the fast edit-test-debug cycle
makes this simple approach very effective.
4. Problem Definition and Analysis
The hardest part of building a software system is deciding precisely what to build.
No other part of the conceptual work is so difficult as establishing the detailed
technical requirement.
Problem definition describes the What of a system, not How. Without defining a
problem, developers do not know what to build, customers do not know what to
expect, and there is no way to validate that the built system satisfies the requirement.
Problem definition and Analysis is the activity that encompasses learning about the
problem to be solved, understanding the needs of customer and users, trying to find
out who the user really is, and understanding all the constraints on the solution. It
includes all activities related to the following:
Identification and documentation of user’s needs.
Creation of a document that describes the external behavior and the association
constraints that will satisfies those needs.
Analysis and validation of the requirements documents to ensure consistency,
completeness, and feasibility
Evolution of needs.
To provide a user friendly, Graphical User Interface (GUI) based integrated
and centralized environment for computerized Instant Messenger.
The proposed system should maintain all the records, and should generate the
required reports and information when required.
To provide efficient and secured Information storage, flow and retrieval
system, ensuring the integrity and validity of records.
To provide graphical and user-friendly interface to interact with a centralized
database based on client-server architecture.
5. System Requirements
SOFTWARE REQUIREMENTS: -
Operating System : Windows 7
Platform : Python IDLE 3.7
Database : MySQL SERVER 5.1
Languages : Python
HARDWARE REQUIREMENTS: -
Processor : Dual Core and above
Hard Disk : 40 GB
Ram : 1024 MB
Note: For Python-MySQL connectivity, the following data have been
used: -
Host- localhost, user- root, password- root, database- hotel
6. System Design & Development
5.1 Database Design:
An important aspect of system design is the design of data storage structure. To begin with
a logical model of data structure is developed first. A database is a container object which
contains tables, queries, reports, and data validation policies enforcement rules or
constraints etc. A logical data often represented as records are kept in different tables after
reducing anomalies and redundancies. The goodness of data base design lies in the table
structure and its relationship.
5.2 TABLE CREATION:
1. GUESTS TABLE
CREATE TABLE `guests` (
`guest_id` int NOT NULL,
`first_name` varchar(255) DEFAULT NULL,
`last_name` varchar(255) DEFAULT NULL,
`phone_number` bigint DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
PRIMARY KEY (`guest_id`)
);
2. ROOMS Table:
CREATE TABLE `rooms` (
`room_number` int NOT NULL,
`room_type` varchar(255) DEFAULT NULL,
`room_status` varchar(255) DEFAULT NULL,
`room_rate` int DEFAULT NULL,
PRIMARY KEY (`room_number`)
);
3. RESERVATIONS TABLE:
CREATE TABLE `reservations` (
`reservation_id` int NOT NULL,
`guest_id` int DEFAULT NULL,
`room_number` int DEFAULT NULL,
`check_in_date` date DEFAULT NULL,
`check_out_date` date DEFAULT NULL,
PRIMARY KEY (`reservation_id`),
KEY `guest_id` (`guest_id`),
KEY `room_number` (`room_number`),
FOREIGN KEY (`guest_id`) REFERENCES `guests` (`guest_id`),
FOREIGN KEY (`room_number`) REFERENCES `rooms` (`room_number`)
);
4. TEMP_VARS TABLE
CREATE TABLE `temp_vars` (
`last_user_id` int DEFAULT NULL,
`last_reservation_id` int DEFAULT NULL,
`sno` int DEFAULT NULL
);
3.
INSERTING TABLE DATA:
INSERT INTO `temp_vars` VALUES (1273,12810,0);
INSERT INTO `rooms` VALUES(1,'VIP','Available',10000),
(2,'VIP','Available',10000), (3,'VIP','Available',10000),
(4,'VIP','Available',10000), (5,'VIP','Available',10000),
(6,'Deluxe',’Available',7000), (7,'Deluxe','Available',7000),
(8,'Deluxe','Available',7000), (9,'Deluxe','Available',7000),
(10,'Deluxe','Available',7000), (11,'Standard','Available',3000),
(12,'Standard','Available',3000), (13,'Standard','Available',3000),
(14,'Standard','Available',3000), (15,'Standard','Available',3000),
(16,'Standard','Available',3000), (17,'Standard','Available',3000),
(18,'Standard','Available',3000), (19,'Standard','Available',3000),
(20,'Standard','Available',3000);
7. Source Code
import mysql.connector as sql
conn = sql.connect(host='localhost', user='root', password='root',
database='hotel')
cur = conn.cursor()
# getting all necessary variables
cur.execute("select * from temp_vars")
vars = cur.fetchall()
guest_id, reservation_id = vars[0][0], vars[0][1]
cur.execute('select * from rooms')
rooms = cur.fetchall()
def menu():
print('''
1. Book a room
2. Display all available room
3. Display all occupied room
4. Display all info
5. Remove a reservation
6. Modify a existing reservation
7. Exit
''')
def book_a_room():
print("Enter your personal details,")
first = input("First Name : ")
last = input("Last Name : ")
phone_num = int(input("Phone Number : "))
email = input("Email Address : ")
room_available = False
while not room_available:
global guest_id
global reservation_id
room_type = input('''
Which type of room you want to book
1. VIP
2. Deluxe
3. Standard
Enter your choice(1/2/3) : ''')
if room_type == '1':
room_type = 'VIP'
elif room_type == '2':
room_type = 'Deluxe'
elif room_type == '3':
room_type = 'Standard'
else:
print('Invalid Choice.\nPlease try again.')
pass
for room in rooms:
room_number = rooms.index(room) + 1
# checking if the requested room is available or not
if room[1] == room_type and room[2] == 'Available':
check_out = input("What will be your check out date (yyyy-mm-dd) :
")
guest_id += room_number
reservation_id += guest_id
query_1 = f"insert into guests values({guest_id}, '{first}',
'{last}', '{phone_num}', '{email}')"
# changing room status
query_2 = f"update rooms set room_status = 'Occupied' where
room_number = {room_number}"
query_3 = f"insert into reservations values({reservation_id},
{guest_id}, {room_number}, curdate(), '{check_out}')"
# updating last used user id and reservation id
query_4 = f"update temp_vars set last_user_id = {guest_id} where
sno = 0"
query_5 = f"update temp_vars set last_reservation_id =
{reservation_id} where sno = 0"
cur.execute(query_1)
cur.execute(query_2)
cur.execute(query_3)
cur.execute(query_4)
cur.execute(query_5)
conn.commit()
print('Booking Successful....')
room_available = True
break
if not room_available:
print(f"{room_type} not available.")
def display_rooms(status):
fields = ["Number", "Type", "Status", "Rate"]
# getting all the required fields
query = f"select * from rooms where room_status = '{status}'"
cur.execute(query)
records = cur.fetchall()
# making space for all fields and aligning them to center
format_string = "| {:^10} "*len(fields)+"|"
header = format_string.format(*fields)
print("-" * len(header))
print(header)
print("-" * len(header))
for entry in records:
print(format_string.format(*entry))
print("-" * len(header))
def display_all_info():
fields = ['Reservation ID', 'Guest ID', 'Room Number', 'Name', 'Phone Number',
'Email Address', 'Room Type', 'Room Rate', 'Check In Date', 'Check Out Date']
# getting all the required fields
query = "select rs.reservation_id,gt.guest_id, rs.room_number,
concat(gt.first_name, ' ',gt.last_name), gt.phone_number, gt.email, rm.room_type,
rm.room_rate, rs.check_in_date, rs.check_out_date from reservations rs, guests gt,
rooms rm where rs.guest_id = gt.guest_id and rs.room_number = rm.room_number"
cur.execute(query)
records = cur.fetchall()
# making space for all fields and aligning them to center
format_string = "| {:^14} | {:^8} | {:^12} | {:^12} | {:^12} | {:^21} | {:^9} |
{:^9} | {:^13} | {:^14} |"
header = format_string.format(*fields)
print("-" * len(header))
print(header)
print("-" * len(header))
for entry in records:
entry = list(entry)
# reformatting date format to mysql default date format
entry[-2] = entry[-2].strftime('%Y-%m-%d')
entry[-1] = entry[-1].strftime('%Y-%m-%d')
print(format_string.format(*entry))
print("-" * len(header))
def remove_a_reservation():
reservation_id = input("""
Enter the Reservation ID you want to delete : """)
print()
query1 = f"select * from reservations where reservation_id = {reservation_id}"
cur.execute(query1)
record = cur.fetchall()[0]
query2 = f"delete from reservations where reservation_id = {reservation_id}"
query3 = f"delete from guests where guest_id = {record[1]}"
# change room status from occupied to available
query4 = f"update rooms set room_status = 'Available' where room_number =
{record[2]}"
cur.execute(query2)
cur.execute(query3)
cur.execute(query4)
conn.commit()
print(f"Successfully removed a reservation.")
def modify_a_reservation():
reservation_id = input("""
Enter the Reservation ID you want to modify : """)
print()
query1 = f"select * from reservations where reservation_id = {reservation_id}"
cur.execute(query1)
record = cur.fetchall()[0]
opt = input("""
Which Table you want to modify
1. Guests
2. Reservations
Enter your choice (1/2) : """)
if opt == "1":
first_name = input("Enter new first name : ")
last_name = input("Enter new last name : ")
phone_number = input("Enter new phone number : ")
email = input("Enter new email : ")
query = f"update guests set first_name = '{first_name}', last_name =
'{last_name}', phone_number = {phone_number},email = '{email}' where guest_id =
{record[1]}"
cur.execute(query)
elif opt == "2":
check_out = input("Enter new check out date (yyyy-mm-dd) : ")
query = f"update reservations set check_out_date = '{check_out}' where
reservation_id = {reservation_id}"
cur.execute(query)
else:
print("Invalid option chosen\nPlease try again...")
conn.commit()
while True:
menu()
option = input("Enter your choice (1-7) : ")
print()
if option == "1":
book_a_room()
elif option == "2":
display_rooms("Available")
elif option == "3":
display_rooms("Occupied")
elif option == "4":
display_all_info()
elif option == "5":
remove_a_reservation()
elif option == "6":
modify_a_reservation()
elif option == "7":
exit()
else:
print("Invalid option chosen\nPlease try again...")
8. Output
1. Book a room
2. Display all available room
3. Display all occupied room
4. Display all info
5. Remove a reservation
6. Modify a existing reservation
7. Exit
Enter your choice (1-7) : 2
-----------------------------------------------------
| Number | Type | Status | Rate |
-----------------------------------------------------
| 4 | VIP | Available | 10000 |
| 5 | VIP | Available | 10000 |
| 6 | Deluxe | Available | 7000 |
| 7 | Deluxe | Available | 7000 |
| 8 | Deluxe | Available | 7000 |
| 9 | Deluxe | Available | 7000 |
| 10 | Deluxe | Available | 7000 |
| 13 | Standard | Available | 3000 |
| 14 | Standard | Available | 3000 |
| 15 | Standard | Available | 3000 |
| 16 | Standard | Available | 3000 |
| 17 | Standard | Available | 3000 |
| 18 | Standard | Available | 3000 |
| 19 | Standard | Available | 3000 |
| 20 | Standard | Available | 3000 |
-----------------------------------------------------
1. Book a room
2. Display all available room
3. Display all occupied room
4. Display all info
5. Remove a reservation
6. Modify a existing reservation
7. Exit
Enter your choice (1-7) : 3
-----------------------------------------------------
| Number | Type | Status | Rate |
-----------------------------------------------------
| 1 | VIP | Occupied | 10000 |
| 2 | VIP | Occupied | 10000 |
| 3 | VIP | Occupied | 10000 |
| 11 | Standard | Occupied | 3000 |
| 12 | Standard | Occupied | 3000 |
-----------------------------------------------------
1. Book a room
2. Display all available room
3. Display all occupied room
4. Display all info
5. Remove a reservation
6. Modify a existing reservation
7. Exit
Enter your choice (1-7) : 4
-----------------------------------------------------------------------------------------------------------------------------------------------------------
| Reservation ID | Guest ID | Room Number | Name | Phone Number | Email Address | Room Type | Room Rate | Check In Date | Check Out Date |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
| 15381 | 1291 | 11 | rakesh gupta | 9854257562 | [email protected] | Standard | 3000 | 2023-11-11 | 2023-12-05 |
| 17976 | 1298 | 1 | sumit gupta | 8977562548 | [email protected] | VIP | 10000 | 2023-11-11 | 2023-12-18 |
| 19286 | 1310 | 12 | arvind gupta | 8784585245 | [email protected] | Standard | 3000 | 2023-11-11 | 2023-12-05 |
| 20598 | 1312 | 2 | rohit saini | 8717862815 | [email protected] | VIP | 10000 | 2023-11-11 | 2023-12-31 |
| 21913 | 1315 | 3 | kartikey raghav | 8745854620 | [email protected] | VIP | 10000 | 2023-11-15 | 2023-12-01 |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
1. Book a room
2. Display all available room
3. Display all occupied room
4. Display all info
5. Remove a reservation
6. Modify a existing reservation
7. Exit
Enter your choice (1-7) : 1
Enter your personal details,
First Name : shourya
Last Name : agarwal
Phone Number : 8487532590
Which type of room you want to book
1. VIP
2. Deluxe
3. Standard
Enter your choice(1/2/3) : 3
What will be your check out date (yyyy-mm-dd) : 2023-11-20
Booking Successful....
1. Book a room
2. Display all available room
3. Display all occupied room
4. Display all info
5. Remove a reservation
6. Modify a existing reservation
7. Exit
Enter your choice (1-7) : 5
Enter the Reservation ID you want to delete : 15381
Successfully removed a reservation.
1. Book a room
2. Display all available room
3. Display all occupied room
4. Display all info
5. Remove a reservation
6. Modify a existing reservation
7. Exit
Enter your choice (1-7) : 2
-----------------------------------------------------
| Number | Type | Status | Rate |
-----------------------------------------------------
| 4 | VIP | Available | 10000 |
| 5 | VIP | Available | 10000 |
| 6 | Deluxe | Available | 7000 |
| 7 | Deluxe | Available | 7000 |
| 8 | Deluxe | Available | 7000 |
| 9 | Deluxe | Available | 7000 |
| 10 | Deluxe | Available | 7000 |
| 11 | Standard | Available | 3000 |
| 14 | Standard | Available | 3000 |
| 15 | Standard | Available | 3000 |
| 16 | Standard | Available | 3000 |
| 17 | Standard | Available | 3000 |
| 18 | Standard | Available | 3000 |
| 19 | Standard | Available | 3000 |
| 20 | Standard | Available | 3000 |
-----------------------------------------------------
1. Book a room
2. Display all available room
3. Display all occupied room
4. Display all info
5. Remove a reservation
6. Modify a existing reservation
7. Exit
Enter your choice (1-7) : 3
-----------------------------------------------------
| Number | Type | Status | Rate |
-----------------------------------------------------
| 1 | VIP | Occupied | 10000 |
| 2 | VIP | Occupied | 10000 |
| 3 | VIP | Occupied | 10000 |
| 12 | Standard | Occupied | 3000 |
| 13 | Standard | Occupied | 3000 |
-----------------------------------------------------
1. Book a room
2. Display all available room
3. Display all occupied room
4. Display all info
5. Remove a reservation
6. Modify a existing reservation
7. Exit
Enter your choice (1-7) : 4
-----------------------------------------------------------------------------------------------------------------------------------------------------------
| Reservation ID | Guest ID | Room Number | Name | Phone Number | Email Address | Room Type | Room Rate | Check In Date | Check Out Date |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
| 17976 | 1298 | 1 | sumit gupta | 8977562548 | [email protected] | VIP | 10000 | 2023-11-11 | 2023-12-18 |
| 19286 | 1310 | 12 | arvind gupta | 8784585245 | [email protected] | Standard | 3000 | 2023-11-11 | 2023-12-05 |
| 20598 | 1312 | 2 | rohit saini | 8717862815 | [email protected] | VIP | 10000 | 2023-11-11 | 2023-12-31 |
| 21913 | 1315 | 3 | kartikey raghav | 8745854620 | [email protected] | VIP | 10000 | 2023-11-15 | 2023-12-01 |
| 23241 | 1328 | 13 | shourya agarwal | 8487532590 | [email protected] | Standard | 3000 | 2023-11-15 | 2023-11-20 |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
1. Book a room
2. Display all available room
3. Display all occupied room
4. Display all info
5. Remove a reservation
6. Modify a existing reservation
7. Exit
Enter your choice (1-7) : 7
9. Reference
In order to work on this project titled Hotel Management System, the following books and
literature are refered by me during the various phases of development of the project.
(1) http://www.mysql.org/
(2) http://www.python.org/
(3) Computer Science for class XII
-by Sumita Arora & Preeti Arora
Other than the above-mentioned books, the suggestions and supervision of my teacher and my class
experience also helped me to develop this software project.