RESTAURANT MANAGEMENT SYSTEM
Submitted By: __________________________
Class: XII
Roll No.: __________________________
School Name: __________________________
1. 1. Introduction
INDEX
2. 2. Objectives
3. 3. System Design
4. 4. ER Diagram
5. 5. Table Structures (Schemas)
6. 6. SQL Queries
7. 7. Python Code
8. 8. Sample Screens (Console Output)
9. 9. Test Cases
10. 10. Reports and Queries
11. 11. Challenges Faced
12. 12. Future Scope
13. 13. Conclusion
14. 14. Bibliography
1. Introduction
The Restaurant Management System is a project
developed using Python and SQL. It aims to manage
staff details, outlet branches, and food menu items in
an efficient manner. The system allows the user to
perform basic operations such as adding, modifying,
and deleting data related to the restaurant's day-to-
day activities. This project is designed as per the CBSE
curriculum and demonstrates the use of Python for
management. 2. Objectives
application development and SQL for database
• To develop a system that manages restaurant
operations using Python and SQL.
• To maintain a centralized database of outlets, staff,
and food items.
• To implement basic CRUD (Create, Read, Update,
Delete) operations.
• To enable easy access and modification of menu and
staff details.
• To present query reports for better decision-making.
3. System Design
The system design includes three core components:
1. Staff Details: Includes employee ID, name, type
(Chef/Waiter), and outlet code.
2. Outlet Management: Maintains information about
outlet code, address, and manager code.
3. Food Menu: Maintains item code, name, price, and
outlet association.
All operations are handled through menu-driven
Python programs interacting with a MySQL database.
4.
Entities:
ER Diagram
- Staff
- Outlet
- Menu
Relationships:
- Each Staff belongs to one Outlet.
- Each Menu Item is associated with one Outlet.
Primary Keys:
- emp_id (Staff)
- outlet_code (Outlet)
- item_code (Menu)
Foreign Keys:
- outlet_code in Staff references Outlet.
- outlet_code in Menu references Outlet.
5. Table Structures
(Schema)
• Table: Outlet
• CREATE TABLE Outlet (
outlet_code INT PRIMARY KEY,
address VARCHAR(100),
manager_code INT
);
• Table: Staff
• CREATE TABLE Staff (
emp_id INT PRIMARY KEY,
name VARCHAR(50),
type VARCHAR(20),
outlet_code INT,
FOREIGN KEY (outlet_code) REFERENCES
Outlet(outlet_code)
);
• Table: Menu
• CREATE TABLE Menu (
item_code INT PRIMARY KEY,
name VARCHAR(50),
price DECIMAL(6,2),
outlet_code INT,
FOREIGN KEY (outlet_code) REFERENCES
Outlet(outlet_code)
);
6. SQL Queries
• Insert into Outlet:
INSERT INTO Outlet VALUES (1, 'Delhi - CP', 101);
• Insert into Staff:
INSERT INTO Staff VALUES (1001, 'Aman', 'Chef', 1);
• Insert into Menu:
INSERT INTO Menu VALUES (201, 'Pasta', 250.00, 1);
• Update Staff Type:
UPDATE Staff SET type = 'Senior Chef' WHERE emp_id
= 1001;
• Delete Menu Item:
DELETE FROM Menu WHERE item_code = 201;
• Select All Staff:
SELECT * FROM Staff;
• Select Items above ₹200:
SELECT * FROM Menu WHERE price > 200;
• Count of Employees per Outlet:
SELECT outlet_code, COUNT(*) FROM Staff GROUP BY
outlet_code;
7. Python
• Database Connection:
Code
import mysql.connector
def get_connection():
return mysql.connector.connect(
host='localhost',
user='root',
password='your_password',
database='restaurant_db'
)
• Add Outlet:
def add_outlet():
conn = get_connection()
cursor = conn.cursor()
code = int(input("Enter Outlet Code: "))
addr = input("Enter Address: ")
mgr = int(input("Enter Manager Code: "))
cursor.execute("INSERT INTO Outlet VALUES (%s,
%s, %s)", (code, addr, mgr))
conn.commit()
conn.close()
• Add Staff:
def add_staff():
conn = get_connection()
cursor = conn.cursor()
eid = int(input("Enter Employee ID: "))
name = input("Enter Name: ")
role = input("Enter Type (Chef/Waiter): ")
oc = int(input("Enter Outlet Code: "))
cursor.execute("INSERT INTO Staff VALUES (%s, %s,
%s, %s)", (eid, name, role, oc))
conn.commit()
conn.close()
• Add Menu Item:
def add_item():
conn = get_connection()
cursor = conn.cursor()
code = int(input("Enter Item Code: "))
name = input("Enter Item Name: ")
price = float(input("Enter Price: "))
oc = int(input("Enter Outlet Code: "))
cursor.execute("INSERT INTO Menu VALUES (%s,
%s, %s, %s)", (code, name, price, oc))
conn.commit()
conn.close()
8. SampleOutput)
(Console Screens
Below are sample outputs of the Python program
during execution:
Sample: Add Outlet