Kartik Gupta and kartik Aggarwal Computer science Project
Kartik Gupta and kartik Aggarwal Computer science Project
Computer Science
Project on
RESTAURANT MANAGEMENT SYSTEM
Session: 2024-25
BY Kartik Aggarwal & Kartik Gupta
Under the guidance of Mrs. Anshu Sharma, Kartik Aggarwal & Kartik
Gupta have demonstrated exceptional skills and dedication throughout the
academic year 2024-25. Their work reflects a thorough understanding of
the subject matter and a commitment to excellence.
We commend Kartik Aggarwal & Kartik Gupta for their hard work and
effort in completing this project.
Signature of Signature of
External Examiner: Internal Examiner:
__________________ ________________________
Acknowledgment
We would like to express our sincere thanks to everyone who played a
significant role in the completion of our computer science project on the
topic: Restaurant Management System.
We are also indebted to our families for their unwavering support. From
providing the necessary resources and facilities to encouraging us every
step of the way, their cooperation has been invaluable. Without their
support, this project would not have been completed.
Finally, we would like to acknowledge our friends, who not only supported
us throughout this journey but also shared their insights and provided
valuable samples. Their guidance and encouragement were crucial in
refining the project at various stages.
Contents
1. Project Overview
o An introduction to the Restaurant Management System,
outlining its objectives, key features, and functionality.
2. Dependencies and Libraries Used
o A list of all the external libraries and dependencies utilized in
the project, including details about their purpose and
installation.
3. Database Structure
o A detailed explanation of the tables created in the MySQL
database, including the schema for the Restaurant records,
Customers, and Employees tables.
4. Implementation in Python
o An overview of the core Python code, explaining how the
system operates, the logic behind key functions, and user
interaction processes.
5. Project Outputs and Results
o A summary of the results produced by the system, including
sample outputs, screenshots, and the overall performance of
the application.
6. References
o A section dedicated to acknowledging the support received during
the project, along with references to any resources or
documentation used in the development process.
Project Overview
The Restaurant Management System project is designed to efficiently manage
various aspects of restaurant operations, focusing on enhancing the overall customer
experience. This system utilizes a MySQL database to keep track of essential
information related to menu management, customer details, order records, and
billing processes.
Key Features:
Database Structure:
o Restaurant records Table: This table stores information about customer
orders, including order number, quantities for various menu items (such as
pizzas, burgers, ice creams, and drinks), cost details, and tax calculations.
o Customers Table: This table keeps records of customer details such as
customer ID, name, contact information, and address, ensuring easy access
and management of customer data.
o Employees Table: this table records employee information, including
employee ID, name, position, contact information, and address, facilitating
efficient staff management.
Administrator Capabilities:
o Menu Management: Administrators can create new menu item records,
update existing item details, view all menu items, and manage stock levels.
o Customer Management: Administrators can add new customer details,
view all customers, and maintain customer records, enhancing customer
relationship management.
o Order Management: Administrators can process orders, view all order
records, generate invoices, and maintain organized billing records.
o Reporting: The system provides functionality to display lists of all menu
items, current stock levels, customer details, order records, and billing
summaries.
Purpose:
The purpose of this project is to streamline restaurant operations, making it easier to
manage menu inventories, order transactions, customer information, and billing processes.
It aims to provide a user-friendly interface for administrators to efficiently handle day-to-
day tasks, ensuring smooth operation and management of restaurant resources.
1. connect():
o This function is integral to the project as it establishes a secure connection to
the MySQL database. It initializes the connection parameters such as the
host, user credentials, password, and database name. Additionally, it checks
for any existing tables in the database, creating them if they do not exist. This
function serves as the foundation for all database operations within the
system, ensuring that the application can interact with the database
effectively.
2. cursor():
o The cursor() function creates a cursor object, which acts as a pointer that
allows the application to execute SQL queries and retrieve results. This object
is essential for managing the context of the SQL commands, as it keeps track
of the current position within the result set. By utilizing the cursor, the
application can perform a variety of operations, including executing SELECT,
INSERT, UPDATE, and DELETE statements.
3. fetchall():
o This function retrieves all rows from the result set generated by a SELECT
query. It returns the results as a list of tuples, where each tuple represents a
row of data. This capability is particularly useful when displaying large
datasets or when the application needs to process multiple records at once. The
fetchall() function simplifies data handling, allowing for easy iteration and
manipulation of the retrieved information.
4. commit():
o The commit() function is responsible for finalizing changes made during the
current transaction. After executing any operation that modifies the database,
such as inserting or updating records, this function must be called to ensure
that those changes are saved permanently. Without calling commit(), any
modifications would be lost once the database connection is closed, making
this function vital for data integrity and consistency.
5. fetchone():
o This function is utilized to retrieve a single row from the result set returned by
a query. It is particularly useful when the application needs to fetch a unique
record or when only one entry is expected as a result.
Database Structure
Database: restaurant_management_system_by_kartik_gupta
TABLE: CUSTOMERS
TABLE: EMPLOYEES
TABLE: RESTAURANTRECORDS
Implementation in Python
Python Source code:
def Database():
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906"
cursor = connectn.cursor()
connectn.database = "Restaurant_Management_System_By_Kartik_Gupta"
cursor.execute("""
""")
cursor.execute("""
cust_name VARCHAR(100),
contact VARCHAR(15),
address VARCHAR(255))
""")
cursor.execute("""
emp_name VARCHAR(100),
position VARCHAR(50),
contact VARCHAR(15),
address VARCHAR(255))
""")
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
# Function to calculate total cost
try:
cost_icecream = icecream_qty * 80
cost_drinks = drinks_qty * 60
service_charge = cost_of_meal / 99
except ValueError:
return None
Database()
if costs:
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
cursor.execute("""
INSERT INTO Restaurantrecords (ordno, piz, bur, ice, dr, ct, sb, tax, sr, tot)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
connectn.commit()
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
def display_orders():
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
orders = cursor.fetchall()
print(order)
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
def delete_order(orderno):
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
cursor.execute("DELETE FROM Restaurantrecords WHERE ordno = %s", (orderno,))
connectn.commit()
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
Database()
if costs:
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
cursor.execute("""
UPDATE Restaurantrecords
SET piz = %s, bur = %s, ice = %s, dr = %s, ct = %s, sb = %s, tax = %s, sr = %s, tot = %s
WHERE ordno = %s
connectn.commit()
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
cursor.execute("""
connectn.commit()
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
def display_customers():
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
customers = cursor.fetchall()
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
def delete_customer(cust_id):
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
connectn.commit()
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
cursor.execute("""
UPDATE Customers
WHERE cust_id = %s
connectn.commit()
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
cursor.execute("""
connectn.commit()
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
def display_employees():
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
employees = cursor.fetchall()
print(employee)
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
connectn.commit()
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
cursor.execute("""
UPDATE Employees
WHERE emp_id = %s
connectn.commit()
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
def generate_bill(orderno):
Database()
try:
connectn = mycon.connect(
host="localhost",
user="root",
password="aksh9906",
database="Restaurant_Management_System_By_Kartik_Gupta"
cursor = connectn.cursor()
order = cursor.fetchone()
if order:
print(f"Pizza Qty: {order[1]}, Burger Qty: {order[2]}, Ice Cream Qty: {order[3]}, Drinks
Qty: {order[4]}")
print(f"Total: {order[9]}")
else:
print(f"Error: {err}")
finally:
cursor.close()
connectn.close()
while True:
print("#" * 70)
print("- Welcome to Restaurant Management System By Kartik Gupta Kartik Aggarwal ")
print("#" * 70)
print("14. Exit")
if choice == '1':
display_orders()
delete_order(orderno)
display_customers()
elif choice == '7':
delete_customer(cust_id)
display_employees()
delete_employee(emp_id)
generate_bill(orderno)
break
else:
Database()
main_menu()
Project Outputs and Results
Python Outputs:
MAIN SCREEN:
Adding an order:
Showing all Orders:
Deleting an order:
Updating an order:
Adding a Customer:
Showing All Customers:
Deleting a Customer:
Updating Customer details:
Adding an Employee:
Showing all Employees:
Deleting an Employee
Updating Employee details:
Generating the Bill:
Exiting the Program:
MySQL:
Software:
Books:
1. Preeti Arora. Computer Science with Python for Class 11th & 12th. Sultan Chand &
Sons.
2. All In One Class 12th Computer Science with Python
3. Progress In Computer Science With Python Textbook & Practical Book For Class 11th
& 12th - by Sumitra Arora