0% found this document useful (0 votes)
81 views15 pages

Document 15

Uploaded by

rishabhmall0012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views15 pages

Document 15

Uploaded by

rishabhmall0012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

NARAYANA EDUCATIONAL SOCIETY (R)

NARAYANA OLYMPIAD
SCHOOL
(Recognized By the Govt. of India, Affiliated to CBSE Board, New Delhi)
Rajeev Gandhinagar circle, AMCO Layout Sahakarnagar
Bangalore-560092.
School Code- 45673, Affiliation Code- 830713

CENTRAL BOARD OF
SECONDARY
EDUCATION
CBSE+2 COMPUTER SCIENCE PROJECT ON
Restaurant Management System
BY:
STUDENT NAME: Prathit V Patil
REG NO:

CENTRAL BOARD OF SECONDARY EDUCATION


Shiksha Kendra, 2, Community Centre, Preet Vihar, Delhi-110 092 India

CERTIFICATE
Certified that the Project Report Entitled
Restaurant Management System

Is Bonafide work carried out by Prathit Patil in Fulfillment of the prescribed Project work
as instructed by the CENTRAL BOARD OF SECONDARY EDUCATION for CBSE+2
PHYSICS during the academic year 2024-2025. The project report has been approved as it
satisfies the academic requirements in respect of Project prescribed for CBSE+2.

……………………… ………………………

Guide Principal

Internal Examiner Signature: ………………………

External Examiner Signature: ………………………

ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the completion of any task would be
incomplete without the mention of the people who made it possible, whose constant guidance and
encouragement ground my efforts with success.

I consider it is a privilege to express my gratitude and respect to all those who guided me
in completion of my project.

It’s a great privilege to place on record my deep sense of gratitude to our Dean, Principal, Project
guide who patronized throughout our project & for the facilities provided to carry out this work
successfully.

I am grateful to my Computer science teacher ………………….. for her invaluable


support and guidance and motivation

I thank the teaching and non-teaching staff members who have helped me directly or
indirectly during the project work.

Finally, I also thank my family and friends for their co-operation and motivation to
complete this project successfully.

STUDENT NAME

Prathit V Patil
Introduction: Restaurant Management System
The Restaurant Management System (RMS) is a project designed to demonstrate the practical
application of database management concepts using Python and MySQL. It focuses on
performing simple operations like storing, retrieving, updating, and deleting data in a structured
and efficient manner. The project serves as a learning tool to highlight how databases can be
seamlessly integrated with a programming language to create functional and user-friendly
applications.
The primary objective of this project is to develop a basic system that allows restaurant staff and
administrators to perform essential tasks, such as:
● Storing data: Recording details about customers, menu items, orders, and bills.
● Retrieving data: Fetching information quickly, such as displaying the menu or retrieving
past order history.
● Updating data: Making changes to the database, like updating menu prices or editing
customer details.
● Deleting data: Removing outdated or unnecessary records, such as old orders or
discontinued menu items.
The project showcases the use of Structured Query Language (SQL) for database operations
and its integration with Python for implementing application logic. MySQL serves as the
backend database system, offering a robust and scalable way to manage data, while Python acts
as the interfce for user interactions and query execution.
Use of the Program in the Modern World
In the modern world, where the food service industry is highly competitive and customer
expectations are continually evolving, a Restaurant Management System (RMS) plays a
crucial role in enhancing operational efficiency and customer satisfaction. Such programs
streamline routine tasks like order processing, inventory management, and billing, reducing the
need for manual labor and minimizing errors. By integratig technology into restaurant
operations, businesses can provide faster service, maintain accurate records, and make data -
driven decisions. Moreover, with the rising popularity of online food delivery and digital
payments, systems like RMS can easily adapt to include features like online order tracking and
payment integration. These capabilities not only improve the overall customer experience but
also allow restaurants to scale their operations while maintaining quality, making RMS an
indispensable tool in the modern food industry.
Features of the Program
1. Menu Storage and Display:
2. The program allows users to store menu items, including their names and prices, in a
database. It can retrieve and display the menu on demand.
3. Order Logging:
Users can input customer orders, which are saved to the database along with a unique order ID
and timestamp. This helps in maintaining a record of all orders placed.
4. Bill Generation:
The system calculates the total bill based on the items ordered and their quantities. It also
provides an option to include taxes or discounts.
5. Database Operations :
a. Add new items, orders, or customer details.
b. View stored data like menu items, past orders, or customer records.
c. Update information such as menu prices or order details.
d. Delete outdated or unnecesssary data, like discontinued menu items.
6. Customer Details Management:
The system can store basic customer information, such as name and contact number, for future
reference or personalized services.
7. Simple User Interface:
The program provides a text-based interface that is easy to navigate, allowing users to interact
with the system through menus and prompts.
8. Search Functionality:
Users can search for specific menu items or orders by keywords, making it easy to locate
information quickly.
9. Basic Error Handling:
The program includes simple mechanisms to handle invalid inputs, such as entering non-numeric
data where numbers are expected.
Source Code:
1. Password.py:
import mysql.connector as sql

# Establishing connection to MySQL database


conn = sql.connect(host="localhost", user="root", password="manager", database="restaurant")
cur = conn.cursor()

print("=========================WELCOME TO THE RESTAURANT


MANAGEMENT SYSTEM==========================")
import time
print()
print(time.ctime())
print()
print("1. REGISTER")
print()
print("2. LOGIN")
print()
n = int(input("Enter your choice: "))
print()

if n == 1:
# User Registration
username = input("Enter a Username: ")
password = int(input("Enter a 4-DIGIT Password: "))

# Insert user data into the database


V_SqlInsert = f"INSERT INTO user_accounts (username, password) VALUES ('{username}',
{password})"
try:
cur.execute(V_SqlInsert)
conn.commit()
print("User registered successfully!")
print("=====================================")
except Exception as e:
print(f"Error: {e}")
print("Registration failed. Please try again.")
print()
print()
import restaurant_main

elif n == 2:
# User Login
username = input("Enter your Username: ")
password = int(input("Enter your 4-DIGIT Password: "))

# Check if the user exists in the database


V_Sql_Sel = f"SELECT * FROM user_accounts WHERE username='{username}' AND
password={password}"
cur.execute(V_Sql_Sel)
if cur.fetchone() is None:
print()
print("Invalid username or password. Please try again.")
print("==============================")
else:
print()
print("Login successful!")
print("==============================")
import restaurant_main
else:
print("Invalid choice! Please restart the program.")
print("==============================")

# Closing the database connection


cur.close()
conn.close()

2.Main.py:
import time
import mysql.connector as sql

# Displaying current time


print(time.ctime())

# Establishing connection to MySQL database


conn = sql.connect(host="localhost", user="root", password="manager", database="restaurant")
cursor = conn.cursor()

# Main menu function


def menu():
print("************************** RESTAURANT MANAGEMENT SYSTEM
**************************")

# Continue the program based on user input


c = input("Do you want to continue (Yes or No): ").strip().capitalize()
while c == "Yes":
print("1. Add Menu Item")
print("2. View Menu")
print("3. Place Customer Order")
print("4. Generate Bill")
print("5. List All Orders")
print("6. Update Menu Item Price")
print("7. Exit")
choice = int(input("Enter your choice: "))

if choice == 1:
add_menu_item()
elif choice == 2:
view_menu()
elif choice == 3:
place_order()
elif choice == 4:
generate_bill()
elif choice == 5:
list_orders()
elif choice == 6:
update_menu_price()
elif choice == 7:
print("Exiting Restaurant Management System")
break
else:
print("Invalid choice! Please try again.")
else:
print("Thank you for using the Restaurant Management System.")

# Function to add a menu item


def add_menu_item():
item_id = int(input("Enter Item ID: "))
item_name = input("Enter Item Name: ")
item_price = float(input("Enter Item Price: "))
sql_insert = f"INSERT INTO menu (item_id, item_name, item_price) VALUES ({item_id},
'{item_name}', {item_price})"
cursor.execute(sql_insert)
conn.commit()
print("Menu item added successfully!")

# Function to view all menu items


def view_menu():
cursor.execute("SELECT * FROM menu")
results = cursor.fetchall()
print("\n--- MENU ---")
for row in results:
print(f"Item ID: {row[0]}, Item Name: {row[1]}, Price: Rs. {row[2]}")
print()

# Function to place a customer order


def place_order():
order_id = int(input("Enter Order ID: "))
customer_name = input("Enter Customer Name: ")
item_id = int(input("Enter Item ID from the Menu: "))
quantity = int(input("Enter Quantity: "))
sql_insert = f"INSERT INTO orders (order_id, customer_name, item_id, quantity) VALUES
({order_id}, '{customer_name}', {item_id}, {quantity})"
cursor.execute(sql_insert)
conn.commit()
print("Order placed successfully!")

# Function to generate a bill for a customer


def generate_bill():
order_id = int(input("Enter Order ID: "))
sql_query = f"""
SELECT o.order_id, o.customer_name, m.item_name, m.item_price, o.quantity,
(m.item_price * o.quantity) AS total_price
FROM orders o
JOIN menu m ON o.item_id = m.item_id
WHERE o.order_id = {order_id}
"""
cursor.execute(sql_query)
result = cursor.fetchall()
print("\n--- BILL ---")
for row in result:
print(f"Order ID: {row[0]}, Customer: {row[1]}, Item: {row[2]}, Price: Rs. {row[3]},
Quantity: {row[4]}, Total: Rs. {row[5]}")
print("Thank you for dining with us!\n")

# Function to list all customer orders


def list_orders():
cursor.execute("SELECT * FROM orders")
results = cursor.fetchall()
print("\n--- ORDERS ---")
for row in results:
print(f"Order ID: {row[0]}, Customer: {row[1]}, Item ID: {row[2]}, Quantity: {row[3]}")
print()

# Function to update the price of a menu item


def update_menu_price():
item_id = int(input("Enter Item ID: "))
new_price = float(input("Enter New Price: "))
sql_update = f"UPDATE menu SET item_price = {new_price} WHERE item_id = {item_id}"
cursor.execute(sql_update)
conn.commit()
print("Menu item price updated successfully!")

# Start the program


menu()

# Closing the database connection


cursor.close()
conn.close()
3.Create_table.py
import mysql.connector as sql

# Establishing connection to MySQL


conn = sql.connect(host="localhost", user="root", password="manager")
mycursor = conn.cursor()

# Enable autocommit
conn.autocommit = True

# Creating the restaurant database


mycursor.execute("CREATE DATABASE restaurant")
mycursor.execute("USE restaurant")

# Creating the user_accounts table for login and registration


mycursor.execute("""
CREATE TABLE user_accounts (
username VARCHAR(50) PRIMARY KEY,
password VARCHAR(100)
)
""")

# Creating the menu table for storing menu items


mycursor.execute("""
CREATE TABLE menu (
item_id INT PRIMARY KEY,
item_name VARCHAR(255),
item_price FLOAT
)
""")

# Creating the orders table for storing customer orders


mycursor.execute("""
CREATE TABLE orders (
order_id INT PRIMARY KEY,
customer_name VARCHAR(255),
item_id INT,
quantity INT,
FOREIGN KEY (item_id) REFERENCES menu(item_id)
)
""")

print("Database and tables created successfully!")

# Closing the connection


mycursor.close()
conn.close()
OUTPUT
=========================WELCOME TO RESTAURANT MANAGEMENT
SYSTEM=========================
Sun Nov 23 16:10:27 2025
1.REGISTER
2.LOGIN
Enter your choice = 1
Enter a Username : Prathit V Patil
Enter a 4 DIGIT Password : 2007
User created successfully
======================================================

=========================WELCOME TO RESTAURANT MANAGEMENT


SYSTEM=========================
Sun Nov 23 16:12:45 2025
************************** RESTAURANT MANAGEMENT SYSTEM
**************************
Do you want to continue (Yes or No): Yes
1. Add Menu Item
2. View Menu
3. Place Customer Order
4. Generate Bill
5. List All Orders
6. Update Menu Item Price
7. Exit
Enter your choice: 1
Enter Item ID: 101
Enter Item Name: Margherita Pizza
Enter Item Price: 250.00
Menu item added successfully!

1. Add Menu Item


2. View Menu
3. Place Customer Order
4. Generate Bill
5. List All Orders
6. Update Menu Item Price
7. Exit
Enter your choice: 1
Enter Item ID: 102
Enter Item Name: Garlic Bread
Enter Item Price: 150.00
Menu item added successfully!

1. Add Menu Item


2. View Menu
3. Place Customer Order
4. Generate Bill
5. List All Orders
6. Update Menu Item Price
7. Exit
Enter your choice: 2

--- MENU ---


Item ID: 101, Item Name: Margherita Pizza, Price: Rs. 250.0
Item ID: 102, Item Name: Garlic Bread, Price: Rs. 150.0

1. Add Menu Item


2. View Menu
3. Place Customer Order
4. Generate Bill
5. List All Orders
6. Update Menu Item Price
7. Exit
Enter your choice: 3
Enter Order ID: 1
Enter Customer Name: Prathit V Patil
Enter Item ID from the Menu: 101
Enter Quantity: 2
Order placed successfully!

1. Add Menu Item


2. View Menu
3. Place Customer Order
4. Generate Bill
5. List All Orders
6. Update Menu Item Price
7. Exit
Enter your choice: 4
Generating bill for Order ID: 1
Customer: Prathit V Patil
Ordered Items: 2 x Margherita Pizza
Total Bill: Rs. 500.0
Bill generated successfully!

1. Add Menu Item


2. View Menu
3. Place Customer Order
4. Generate Bill
5. List All Orders
6. Update Menu Item Price
7. Exit
Enter your choice: 5
Order ID: 1, Customer Name: Prathit V Patil, Item Ordered: Margherita Pizza, Quantity: 2
Total Orders: 1

1. Add Menu Item


2. View Menu
3. Place Customer Order
4. Generate Bill
5. List All Orders
6. Update Menu Item Price
7. Exit
Enter your choice: 6
Enter Item ID to update price: 101
Enter new price: 280.00
Menu item price updated successfully!

1. Add Menu Item


2. View Menu
3. Place Customer Order
4. Generate Bill
5. List All Orders
6. Update Menu Item Price
7. Exit
Enter your choice: 7
Exiting Restaurant Management System

HARDWARE AND SOFTWARE REQUIRED:


Hardware:
● Desktop computer/laptop: A basic computer or laptop is sufficient to run the program
and work with the software tools required for the project.
Software:
● Windows 7 or above: The program can be run on Windows 7 or any later version (e.g.,
Windows 10, Windows 11). Make sure the system has all the latest updates installed for
compatibility.
● Python: Python version 3.x should be installed on your system. Python is the primary
language used for implementing the project, and you can download it from the official
Python website.
● MySQL: MySQL is the database management system used to store and retrieve
restaurant management data. You can install it from the official MySQL website. Make
sure to have a MySQL server running on your system.
● MySQL Python Connector Module: To connect Python to the MySQL database, you
will need the MySQL connector module. You can install it using the following command:
pip install mysql-connector-python

These software components will allow you to interact with the MySQL database from your
Python code, perform CRUD operations, and implement your restaurant management system
successfully.
BIBLIOGRAPHY
1. Arora, Sumita. Computer Science with Python. Sumita Arora, 2019.
a. This book serves as a comprehensive guide to learning Python and implementing various
projects. It provides fundamental concepts that helped in the development of this project.
2. Python.org. Python Official Website. https://www.python.org/
a. The official Python website provides resources, documentation, and downloads for the
Python programming language, which was used for the coding of this project.
3. MySQL Official Website. MySQL Database. https://dev.mysql.com/
a. The official MySQL website contains documentation, tools, and resources related to
MySQL, the database management system used in this project.
4. MySQL Connector for Python. MySQL Python Connector.
https://dev.mysql.com/downloads/connector/python/
a. The MySQL Connector allows Python to connect and interact with MySQL databases.
The connector was essential for integrating Python with MySQL in the development of
this project.

You might also like