antaricksh
antaricksh
VIDYALAYA CRPF
Amerigog
A Project Report on
1|Page
CERTIFICATE
2|Page
ACKNOWLEDGEMENT
3|Page
INDEX
1. Introduction-----------------------------------------
-----.6
2. Feature of Python &
MySQL-------------------------.7
3. The features of MySQL are as
follows:------------.9
4. System
Requirements--------------------------------.10
5. Source
Code----------------------------------------.11-32
6. Screen
Shot---------------------------------------------.33
Sql database-
i. Main
table--------------------------------------.33
ii. Customer
table-------------------------------.34
iii. Employee
table-------------------------------.35
4|Page
iv. Feedback
table-------------------------------.36
v. Food
table-------------------------------------.37
vi. Orderfood
table------------------------------.38
Python output-
i. Main
menu-------------------------------------.39
ii. Employee
menu------------------------------.40
iii. Customer
menu-------------------------------.41
iv. Food
menu-------------------------------------.42
v. Orderfood
menu------------------------------.43
vi. view--------------------------------------------
--.44
Employee
details-------------------44
Customer
details------------------.45
Food
details------------------------.46
5|Page
Orederfood
details----------------.47
Feedback
details------------------.48
Return to main
manu-------------.49
vii. Feedback
menu-------------------------.50
viii. Exit
menu--------------------------------.51
7. Bibliography/
Reference-----------------------------.52
6|Page
Introduction
7|Page
Feature of Python & MySQL
Python is a dynamic, high level, free open source and
interpreted programming language. It supports object-oriented
programming as well as procedural oriented programming.
8|Page
6. Extensible feature: Python is a Extensible language.we can
write our some python code into c or c++ language and also
we can compile that code in c/c++ language.
9|Page
The features of MySQL are
as follows:
10 | P a g e
8. High Availability – MySQL can run high-speed master/slave
replication configurations and it offers cluster servers.
9. Scalability & Flexibility – With MySQL you can run deeply
embedded applications and create data warehouses holding a
humongous amount of data.
System Requirement
Recommended System Requirements
Disk space: 2 to 3 GB
Disk space: 1 GB
RAM: 4 GB (6 GB recommended)
Source Code
import os
import platform
import mysql.connector
import pandas as pd
mydb = mysql.connector.connect(host="localhost",
user="root", password="W7301@jqir#", database="food1")
mycursor = mydb.cursor()
12 | P a g e
# Creating Tables if they do not exist
mycursor.execute("""
emp_g VARCHAR(10),
eage INT,
emp_phone BIGINT,
pwd VARCHAR(255)
""")
mycursor.execute("""
cphone BIGINT,
payment INT,
13 | P a g e
pstatus VARCHAR(20),
email VARCHAR(255),
orderid INT,
date DATE
""")
mycursor.execute("""
Food_size VARCHAR(20),
prize INT
""")
mycursor.execute("""
Emp_id INT,
Food_id INT,
Food_qty INT,
Total_price INT
""")
mycursor.execute("""
c_id INT,
feedback_text TEXT,
feedback_date DATE,
""")
L = []
while True:
try:
break
else:
except ValueError:
L.append(c_id)
L.append(feedback_text)
16 | P a g e
feedback_date = date.today()
L.append(feedback_date)
feedback_data = tuple(L)
mycursor.execute(sql, feedback_data)
mydb.commit()
def get_food_price(Food_id):
result = mycursor.fetchone()
17 | P a g e
def Customer():
L = []
L.append(name)
while True:
try:
if len(str(cphone)) == 10:
break
else:
except ValueError:
L.append(cphone)
18 | P a g e
payment = input("Enter payment method (1 for Credit
Card, 2 for Debit Card): ").strip()
L.append(int(payment))
L.append(pstatus)
L.append(email)
L.append(orderid)
cust = tuple(L)
mycursor.execute(sql, cust)
mydb.commit()
def Employee():
L = []
L.append(ename)
L.append(emp_g)
20 | P a g e
while True:
try:
if eage > 0:
break
else:
except ValueError:
L.append(eage)
while True:
try:
if len(str(emp_phone)) == 10:
break
else:
21 | P a g e
print("Phone number should be 10 digits. Try
again.")
except ValueError:
L.append(emp_phone)
L.append(pwd)
EMP = tuple(L)
mycursor.execute(sql, EMP)
mydb.commit()
def Food():
22 | P a g e
L = []
L.append(Foodname)
L.append(Food_size)
while True:
try:
if prize > 0:
break
else:
except ValueError:
L.append(prize)
23 | P a g e
Food_data = tuple(L)
mycursor.execute(sql, Food_data)
mydb.commit()
def OrderFood():
L = []
while True:
try:
break
except ValueError:
L.append(C_id)
24 | P a g e
while True:
try:
break
except ValueError:
L.append(Emp_id)
while True:
try:
break
else:
25 | P a g e
except ValueError:
L.append(Food_id)
while True:
try:
if Food_qty > 0:
break
else:
except ValueError:
L.append(Food_qty)
L.append(Total_price)
26 | P a g e
Order_data = tuple(L)
mycursor.execute(sql, Order_data)
mydb.commit()
def display_view_menu_box():
view_options = [
27 | P a g e
print("╔" + "═" * 38 + "╗")
def View():
display_view_menu_box()
try:
if choice == 1:
28 | P a g e
mycursor.execute("SELECT * FROM Employee")
records = mycursor.fetchall()
print("\nEmployee Details:")
print(record)
elif choice == 2:
records = mycursor.fetchall()
print("\nCustomer Details:")
print(record)
elif choice == 3:
records = mycursor.fetchall()
print("\nFood Details:")
print(record)
elif choice == 4:
print("\nOrder Details:")
print(record)
elif choice == 5:
records = mycursor.fetchall()
print("\nFeedback:")
print(record)
elif choice == 6:
else:
except ValueError:
30 | P a g e
def display_menu_box():
options = [
"7. Exit"
def MenuSet():
display_menu_box()
try:
if userInput == 1:
Employee()
elif userInput == 2:
Customer()
elif userInput == 3:
Food()
elif userInput == 4:
OrderFood()
elif userInput == 5:
View()
32 | P a g e
elif userInput == 6:
Feedback()
elif userInput == 7:
print("Exiting program.")
exit()
else:
except ValueError:
MenuSet()
33 | P a g e
------------------SQL
DATABASE-------------
34 | P a g e
----------------------- CUSTOMER
TABLE-----------------------
35 | P a g e
-----------------------EMPLOYEE
TABLE-------------------------
36 | P a g e
DATA IN EMPLOYEE TABLE:
---------------------FEEDBACK
TABLE----------------------
37 | P a g e
DATA IN FEEDBACK TABLE
--------------------------FOOD
TABLE----------------------
38 | P a g e
DATA IN FOOD TABLE
---------------------ORDERFOOD
TABLE------------------
MAIN MENU
40 | P a g e
1.EMPLOYEE MENU-
41 | P a g e
2.CUSTOMER MENU-
42 | P a g e
3.FOOD MENU-
43 | P a g e
4.ORDER FOOD MENU-
5.VIEW MENU-
44 | P a g e
i.EMPLOYEE DETAILS-
ii.CUSTOMER DETAILS-
45 | P a g e
iii.FOOD DETAILS-
46 | P a g e
iv.ORDER FOOD DETAILS-
47 | P a g e
V.FEEDBACK MENU-
48 | P a g e
vi.RETURN TO MAIN MENU-
49 | P a g e
6.FEEDBACK MENU-
50 | P a g e
7.EXIT MENU-
51 | P a g e
Bibliography/Reference
In order to work on this project, the following books and
literature are referred by me during the various phases of
development of the project:
Reference Book:
Computer Science by : Sumita Arora
Reference Websites:
www.google.com
www.python.org
www.w3schools.com
www.mysql.com
www.mysqltutorial.org
www.pythontrends.wordpress.com
52 | P a g e