Bakery ShopManagement
Bakery ShopManagement
Submitted By :-
Name –
Class –
Roll No. -
CERTIFICATE
This is to certify that the project entitled
“Bakery Shop” has been prepared under
my guidance and supervision by
Name :
Roll No:
Class :
ACKNOWLEDGEMENT
INTRODUCTION
This is a programme that processes the way
a shop works and has been made by
integrating the MYSQL database with Python
(My SQL connector ) which presents this
project in an easy and understandable way .
This project also shows the application of
Database Management System in python
using My SQL and My SQL connector.
c=mysql.connector.connect(host="localhost",user="root",passwd="1234"
,database="BAKERY")
d=c.cursor()
def create_t():
c.commit()
def search_prod():
print(33*'_')
print("%s%10s%3s%10s%3s%3s%3s"%('|','Item','|','Cost','|','Id','|'))
print(33*'=')
for i in d:
print("%s%10s%3s%10s%3s%3s%3s"%('|',i[0],'|',i[1],'|',i[2],'|'))
print(33*'-')
def search_cost():
print(33*'_')
print("%s%10s%3s%10s%3s%3s%3s"%('|','Item','|','Cost','|','Id','|'))
print(33*'=')
for i in d:
print("%s%10s%3s%10s%3s%3s%3s"%('|',i[0],'|',i[1],'|',i[2],'|'))
print(33*'-')
def disp_prod():
print(33*'_')
print("%s%10s%3s%10s%3s%3s%3s"%('|','Item','|','Cost','|','Id','|'))
print(33*'=')
for i in d:
print("%s%10s%3s%10s%3s%3s%3s"%('|',i[0],'|',i[1],'|',i[2],'|'))
print(33*'-')
def customer_info():
d.execute("select*from customer")
print(105*'_')
print("%s%15s%3s%50s%3s%12s%3s%15s%3s"%('|','Customer
Id','|','Products','|','Total Qty','|','Grand Total','|'))
print(105*'=')
for i in d:
print("%s%15s%3s%50s%3s%12s%3s%15s%3s"%
('|',i[0],'|',i[1],'|',i[2],'|',i[3],'|'))
print(105*'-')
def update_cost():
def delete_item():
print(33*'_')
print("%s%10s%3s%10s%3s%3s%3s"%('|','Item','|','Cost','|','Id','|'))
print(33*'=')
for i in d:
print("%s%10s%3s%10s%3s%3s%3s"%('|',i[0],'|',i[1],'|',i[2],'|'))
print(33*'-')
c.commit()
def add_new_item():
c.commit()
def bill():
all_prod=""
gt=0
qty1=0
while True:
print("1.Cake")
print("2.Pastry")
print("3.Biscuits")
print("4.Bread")
print("5.Muffin")
print("6.Donut")
t=0
for i in d:
product=i[0]
cost=i[1]
total=qty*cost
gt=gt+total
all_prod=product+','+all_prod
qty1=qty1+qty
if kk=='no':
break
print(52*'_')
print("%s%15s%3s%7s%3s%10s%3s%7s%3s"%
('|','Products','|','Cost','|','Quantity','|','Total','|'))
print(52*'=')
for i in d:
print("%s%15s%3s%7s%3s%10s%3s%7s%3s"%
('|',i[0],'|',i[1],'|',i[2],'|',i[3],'|'))
print(52*'-')
c.commit()
while True:
print("1.Display ")
print("2.Delete ")
print("3.Search")
print("4.Update")
print("5.Purchase")
print("6.Exit")
if hh==1:
print("1.Display menu")
if dd==1:
disp_prod()
elif dd==2:
customer_info()
elif hh==2:
delete_item()
elif hh==3:
print("1.Search by Name")
print("2.Search by Cost")
if dd==1:
search_prod()
elif dd==2:
search_cost()
elif hh==4:
print("1.Update Cost")
if df==1:
update_cost()
elif df==2:
add_new_item()
elif hh==5:
bill()
elif hh==6:
break
c.close()
Output
Displays Menu and Customer
Info
Deleting a Product
Searching Product by Name
and Cost
Adding new product
Updating Cost of Product
Initial Table