Project Report Submitted for Internal Examination
ON RESTURANT MANAGEMENT SYSTEM
USING PYTHON AND MYSQL
Class: XII COM ‘C’
Roll No: _______
Academic Year: 2025-26
Submitted By: Submitted to:
Megha Jain Mr. Soumya Nayak
CERTIFICATE
This is to certify that Megha Jain, a student of Class XII commerce of
Academic World School, has successfully completed the project titled
“Restaurant Management” as part of the CBSE Curriculum for the
academic session 2024–25 under my guidance.
Teacher’s Signature:
2
ACKNOWLODGEMENT
I would like to express my sincere gratitude to my Informatics Practices
teacher, Mr. Soumya Nayak, for valuable guidance, encouragement, and
support in completing this project. I also thank my school principal and
classmates for their cooperation.
3
TABLE OF CONTENTS
S. No. Contents Page No..
1 Certificate 2-2
2 Acknowledgement 3-3
3 Introduction 5-5
4 Objective 6-6
5 Tools and Technologies Used 7-7
6 Project Description
(working of the project) 8-8
7 Source Code 9-14
8 Output Screenshots 15-22
9 Conclusion 23-23
10 Bibliography 24-24
4
INTRODUCTION
The Restaurant Management System developed in this project is a simple yet efficient software
application designed to streamline basic restaurant operations using Python as the front-end
programming language and MySQL as the back-end database. The system enables smooth
handling of essential tasks such as managing menu items, taking customer orders, calculating
bills, and storing transaction details securely.
The project demonstrates how Python can be used to build an interactive, user-friendly interface
for entering and processing data, while MySQL ensures reliable storage, retrieval, and
management of restaurant records. With features like adding menu items, viewing the menu,
recording customer orders, generating final bills, and maintaining order history, the system
provides a structured approach to daily restaurant activities.
This project highlights the practical integration of programming and database concepts,
including SQL queries, CRUD operations, exception handling, loops, conditionals, and modular
coding in Python. It shows how technology can reduce manual workload, minimize errors, and
improve accuracy and speed in service-based businesses. Overall, the Restaurant Management
System serves as a real-world example of how Python and MySQL can work together to solve
everyday management problems in the hospitality industry.
5
OBJECTIVE
The main objectives of the Restaurant Management System developed using Python and MySQL are
as follows:
1. To automate basic restaurant operations such as managing menu items, taking orders,
and generating bills, reducing manual effort and errors.
2. To create a user-friendly Python interface that allows staff to easily enter customer
orders, view the menu, and process transactions.
3. To store and manage restaurant data efficiently using a MySQL database that
supports fast retrieval, modification, and secure storage of records.
4. To demonstrate integration between Python and MySQL, showcasing how
programming logic and database management can work together in real-world
applications.
5. To ensure accuracy in billing and calculations by automatically computing item
totals, quantities, and final amounts.
6. To maintain order records so that previous orders and transactions can be easily
reviewed and analyzed.
7. To design a system that is scalable and easy to modify, allowing additional features
like customer details, GST calculation, or digital receipts to be added in the future.
8. To provide a practical understanding of concepts like SQL queries, CRUD
operations, loops, functions, error handling, and modular programming.
6
TOOLS & TECHNOLOGIES USED
1. Python (Programming Language)
Used to develop the application’s logic, user interface, and backend processing such as
order entry, billing, and menu display.
2. MySQL (Database Management System)
Used to store and manage restaurant data including menu items, prices, and order
records. Ensures fast, secure, and reliable data handling.
3. MySQL Connector for Python
A connector library that allows Python to communicate with the MySQL database using
SQL queries.
4. PyCharm / VS Code (IDE)
Used for writing, testing, and debugging the Python code efficiently.
5. Command Line / MySQL Workbench
Used to create, update, and view the database tables.
7
PROJECT DESCRIPTION
The Restaurant Management System developed in this project is a Python-based
application integrated with a MySQL database to simplify and automate key
restaurant operations. The system is designed to help restaurant staff efficiently
manage menu items, take customer orders, calculate bills, and store transaction
details without relying on manual paperwork.
Python is used to create the user interface and business logic that handles tasks
such as displaying the menu, entering item quantities, validating inputs, and
performing billing calculations. MySQL acts as the backend database where all
essential data—such as menu items, prices, and order details—are stored in a
structured format. The connection between Python and MySQL is achieved using
the [Link] module, enabling smooth data retrieval and updates.
The project demonstrates how programming and database concepts can be
combined to build a real-world management system. It uses core Python
techniques like loops, functions, modular programming, and exception handling to
ensure a smooth user experience. SQL operations such as creating tables, inserting
records, updating menu details, and fetching order information form the
foundation of the database component.
Overall, this Restaurant Management System provides a reliable, user-friendly, and
efficient solution for small restaurant operations. It minimizes human errors,
speeds up the billing process, and ensures proper data management—making it an
ideal example of practical application of Python and MySQL integration in real-life
scenarios.
8
SOURCE CODE
import [Link]
from [Link] import canvas
from datetime import datetime
# ---------------------------------------------------
# CONNECT TO MYSQL
# ---------------------------------------------------
mydb = [Link](
host="localhost",
user="root",
password="123456"
)
cursor = [Link]()
# ---------------------------------------------------
# DATABASE + TABLE CREATION (CLEAN SETUP)
# ---------------------------------------------------
[Link]("CREATE DATABASE IF NOT EXISTS restaurant_db")
[Link]("USE restaurant_db")
[Link]("DROP TABLE IF EXISTS order_details")
[Link]("DROP TABLE IF EXISTS orders")
[Link]("DROP TABLE IF EXISTS menu_items")
[Link]("""
CREATE TABLE menu_items (
item_id INT PRIMARY KEY AUTO_INCREMENT,
item_name VARCHAR(100),
price FLOAT
)
""")
[Link]("""
CREATE TABLE orders (
order_id INT PRIMARY KEY AUTO_INCREMENT,
customer_name VARCHAR(100),
total_amount FLOAT
)
""")
[Link]("""
CREATE TABLE order_details (
detail_id INT PRIMARY KEY AUTO_INCREMENT,
9
order_id INT,
item_id INT,
quantity INT,
FOREIGN KEY (order_id) REFERENCES orders(order_id),
FOREIGN KEY (item_id) REFERENCES menu_items(item_id)
)
""")
# ---------------------------------------------------
# FUNCTIONS
# ---------------------------------------------------
def add_menu_item():
try:
name = input("Enter item name: ")
price = float(input("Enter price: "))
[Link]("INSERT INTO menu_items (item_name, price) VALUES (%s, %s)",
(name, price))
[Link]()
print("✔ Item added successfully!\n")
except Exception as e:
print(f" ❌ Error: {e}\n")
def update_menu_item():
show_menu()
try:
id = int(input("Enter item ID to update: "))
new_name = input("Enter new name: ")
new_price = float(input("Enter new price: "))
[Link]("UPDATE menu_items SET item_name=%s, price=%s WHERE
item_id=%s",
(new_name, new_price, id))
[Link]()
print("✔ Menu updated successfully!\n")
except Exception as e:
print(f" ❌ Error: {e}\n")
def delete_menu_item():
show_menu()
try:
id = int(input("Enter item ID to delete: "))
[Link]("DELETE FROM menu_items WHERE item_id=%s", (id,))
[Link]()
print("✔ Item deleted!\n")
10
except Exception as e:
print(f" ❌ Error: {e}\n")
def show_menu():
[Link]("SELECT * FROM menu_items")
data = [Link]()
print("\n------------ MENU ITEMS ------------")
for row in data:
print(f"ID: {row[0]} | {row[1]} | Price: ₹{row[2]}")
print("------------------------------------\n")
def place_order():
try:
customer = input("Enter customer name: ")
order_items = []
total = 0
while True:
show_menu()
item_id = int(input("Enter Item ID: "))
qty = int(input("Quantity: "))
[Link]("SELECT item_name, price FROM menu_items WHERE
item_id=%s", (item_id,))
item = [Link]()
if not item:
print(" ❌ Invalid item ID!")
continue
name, price = item
print(f"Added: {name} x {qty}")
total += price * qty
order_items.append((item_id, qty))
more = input("Add more items? (y/n): ").lower()
if more != "y":
break
[Link]("INSERT INTO orders (customer_name, total_amount) VALUES
(%s, %s)",
(customer, total))
[Link]()
order_id = [Link]
11
for item in order_items:
[Link]("INSERT INTO order_details (order_id, item_id, quantity)
VALUES (%s, %s, %s)",
(order_id, item[0], item[1]))
[Link]()
print(f"\n✔ Order placed successfully!")
print(f"✔ Order ID: {order_id}")
print(f"✔ Total Amount: ₹{total}\n")
print("Generating PDF Invoice...\n")
generate_bill_pdf(order_id)
except Exception as e:
print(f" ❌ Error: {e}\n")
def view_orders():
[Link]("SELECT * FROM orders")
data = [Link]()
print("\n----------- ALL ORDERS -----------")
for row in data:
print(f"Order ID: {row[0]} | Customer: {row[1]} | Total: ₹{row[2]}")
print("----------------------------------\n")
def search_order():
try:
oid = int(input("Enter Order ID: "))
[Link]("SELECT * FROM orders WHERE order_id=%s", (oid,))
order = [Link]()
if not order:
print(" ❌ Order not found!\n")
return
print(f"\nOrder ID: {order[0]}")
print(f"Customer: {order[1]}")
print(f"Total Amount: ₹{order[2]}\n")
except Exception as e:
print(f" ❌ Error: {e}\n")
def generate_bill_pdf(order_id):
file_name = f"Bill_{order_id}.pdf"
c = [Link](file_name)
12
[Link]("Helvetica-Bold", 18)
[Link](150, 800, "RESTAURANT INVOICE")
[Link]("Helvetica", 12)
[Link](50, 770, f"Order ID: {order_id}")
[Link](50, 755, f"Date: {[Link]().strftime('%d-%m-%Y %H:%M:%S')}")
[Link]("SELECT customer_name, total_amount FROM orders WHERE
order_id=%s", (order_id,))
order = [Link]()
[Link](50, 740, f"Customer: {order[0]}")
y = 700
[Link](50, y, "Item")
[Link](250, y, "Qty")
[Link](350, y, "Price")
[Link]("""
SELECT menu_items.item_name, order_details.quantity, menu_items.price
FROM order_details
JOIN menu_items ON order_details.item_id = menu_items.item_id
WHERE order_details.order_id=%s
""", (order_id,))
data = [Link]()
y -= 20
for row in data:
[Link](50, y, row[0])
[Link](250, y, str(row[1]))
[Link](350, y, f"₹{row[2]}")
y -= 20
[Link](50, y - 20, f"Total Amount: ₹{order[1]}")
[Link]()
print(f"✔ Invoice saved as {file_name}\n")
# ---------------------------------------------------
# MAIN MENU
# ---------------------------------------------------
while True:
print("""
========= RESTAURANT MANAGEMENT SYSTEM =========
1. Add Menu Item
2. Update Menu Item
3. Delete Menu Item
4. Show Menu
13
5. Place Order
6. View All Orders
7. Search Order by ID
8. Exit
""")
try:
choice = int(input("Enter your choice: "))
except:
print(" ❌ Please enter a valid number!\n")
continue
if choice == 1:
add_menu_item()
elif choice == 2:
update_menu_item()
elif choice == 3:
delete_menu_item()
elif choice == 4:
show_menu()
elif choice == 5:
place_order()
elif choice == 6:
view_orders()
elif choice == 7:
search_order()
elif choice == 8:
print("Exiting... Thank you!")
break
else:
print(" ❌ Invalid option!\n")
14
OUTPUT SCREENSHOT
15
16
17
18
19
20
21
22
CONCLUSION
The Restaurant Management System, developed using Python and MySQL,
successfully demonstrates how technology can simplify and automate routine
restaurant operations. The project efficiently handles essential tasks such as
managing menu items, taking customer orders, generating accurate bills, and
maintaining order records in a structured database. By integrating Python’s logical
capabilities with MySQL’s powerful data management features, the system ensures
higher accuracy, faster processing, and reduced manual errors.
This project also enhances understanding of important concepts like database
connectivity, SQL queries, modular programming, loops, and exception handling.
Overall, the Restaurant Management System provides a practical, real-world
example of how programming and database management can work together to
create an efficient and user-friendly application. It serves as a strong foundation for
further improvements and can be expanded with features such as GST calculation,
customer details, a graphical interface, or digital receipts.
23
BIBLIOGRAPHY
1. Python Programming Documentation
([Link]
2. MySQL Official Documentation
([Link]
3. W3Schools – Python & SQL Tutorials
([Link]
4. GeeksforGeeks – Python & Database Connectivity Articles
([Link]
5. Class Notes and Teacher Guidance
6. Reference Books on Python Programming and SQL Concepts
24