Bakery Management
Bakery Management
Pandey
Class : 12th
Adm no. :
Session : 2024-25
School : sanskar
Public school
Bakery
manageme
t
Contents of the
project
� Certificate of Authenticity
� Acknowledgement
� Introduction
� Source Code
� Conclusion
� Bibliography
Certificate of
authenticity
Student’s Teacher’s
Signature Signature
Acknowledgement
Introduction
Source code
Connecting Python to MySQL &
Creating Database and Tables
#library import
import mysql.connector as sql
#setting connection
mydb = sql.connect(host = "localhost", user = "root", password = "")
#making cursor
cr = mydb.cursor()
#creating database
q = "create database super_markett"
cr.execute(q)
q = "use super_markett"
cr.execute(q)
#bakery
q = '''create table bakery(cid integer primary key,
cake varchar(30) not null,
flavour varchar(50),
dateofm date,
weight float,
content varchar(100),
price float)'''
cr.execute(q)
#BILLS
q = '''create table bills(store_name varchar(15) not null,
cname varchar(20),
date_of_pur date,
amount float)'''
cr.execute(q)
mydb.commit()
MAIN code
#library import
import time
import random as rd
def bakery():
def additem():
print("\n")
print("😇🙃"*10)
print("\n")
cid = input("What's the Code of the Dish You want to add : ")
cake = input("Which type of Dish you want to add (cake / pizza / pastry / etc (name) : ")
time.sleep(2)
data = (cid,cake,flavour,dateofm,weight,content,price)
cr = mydb.cursor()
cr.execute(q,data)
time.sleep(1)
print("😎"*10)
print("\n")
mydb.commit()
def refillitem():
cid = input("Enter the Code of the Dish whose ingredients/flavour you want to Change : ")
if a == 1:
d = (flavour1,cid)
cr = mydb.cursor()
cr.execute(q,d)
print("\n")
print("😎😄"*8)
print("FLAVOUR CHANGED......!!")
print("😎😄"*8)
print("\n")
mydb.commit()
elif a == 2:
d = (content1,cid)
cr = mydb.cursor()
cr.execute(q,d)
print("\n")
print("😎😄"*8)
print("INGREDIENTS UPDATED......!!")
print("😎😄"*8)
print("\n")
mydb.commit()
else:
print("\n")
def showitems():
print("😄"*10)
cr = mydb.cursor()
cr.execute(q)
res = cr.fetchall()
print("\n","-"*95)
print("Code\tName\t\tflavour\t\tweight\t\tPrice")
print("-"*95)
for k in res:
print(k[0],"\t",k[1],"\t\t",k[2],"\t\t",k[-3],"\t\t",k[-1])
print("-"*95)
def searchitem():
cr = mydb.cursor()
cr.execute(q)
k = cr.fetchone()
if k == None:
print("😣😣"*10)
else:
print("\nDish Found......!!")
print("😀😀"*10,"\n")
print("-"*95)
print("Code\tName\t\tflavour\t\tweight\t\tPrice")
print("-"*95)
print(k[0],"\t",k[1],"\t\t",k[2],"\t\t",k[-3],"\t\t",k[-1])
print("-"*95)
def deleteitem():
cr = mydb.cursor()
cr.execute(q)
print("\nDish Deleted......!!\n")
print("😒😒"*10)
print("\n\n")
mydb.commit()
def billitem():
amount = 0
cr = mydb.cursor()
while True:
cr.execute(q)
res = cr.fetchone()
if res == None:
print("😣😣"*10)
else:
price = int(res[-1])
qty = int(input("How Many Piece of the Item You Want to Have : "))
amount += bill
ans = input("Do You Want to Have More Food in Your House : ")
if ans.lower() == "no":
time.sleep(2)
break
cr.execute(q,data)
mydb.commit()
def displaybill():
print("😄"*10)
cr = mydb.cursor()
cr.execute(q)
res = cr.fetchall()
print("\n")
print("-"*95)
print("shop_name\tcustomer_name\t\tDate_of_Pur\t\tAmount")
print("-"*95)
for k in res:
print(k[0],"\t",k[1],"\t\t",k[-2],"\t\t",k[-1])
print("-"*95)
print("\n")
while True:
print("😇🙃"*10)
print("😇🙃"*10)
print("\n")
print("\n")
if opt == 1:
additem()
elif opt == 2:
refillitem()
elif opt == 3:
showitems()
elif opt == 4:
searchitem()
elif opt == 5:
deleteitem()
elif opt == 6:
billitem()
elif opt == 7:
displaybill()
elif opt == 8:
print("✌😄"*10)
print("*"*95)
break
else:
break
#setting connection
#making cursor
cr = mydb.cursor()
#Selecting database
q = "use super_markett"
cr.execute(q)
#login screen
a = rd.randint(1,9)
b = rd.randint(1,9)
c = rd.randint(1,9)
d = rd.randint(1,9)
e = rd.randint(1,9)
num = str(a)+str(b)+str(c)+str(d)+str(e)
print("\t\t",num)
if str(n) == num:
print("🥳🎁"*8)
print("\n")
print("🥳🎁"*8)
if ch == 1:
bakery()
elif ch == 2:
print("🙃"*10)
print("🙃"*10)
break
else: print
print("Try Again......!!!")
Output
31383
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
AHNOOR BAKERY CORNER
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
Which type of Dish you want to add (cake / pizza / pastry / etc (name) : Cake
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
Which type of Dish you want to add (cake / pizza / pastry / etc (name) : Pastry
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
Which type of Dish you want to add (cake / pizza / pastry / etc (name) : Pizza
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
What's the Code of the Dish You want to add : 104
Which type of Dish you want to add (cake / pizza / pastry / etc (name) : cold drinks
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
Which type of Dish you want to add (cake / pizza / pastry / etc (name) : Burger
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
Which type of Dish you want to add (cake / pizza / pastry / etc (name) : pastry
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
Which type of Dish you want to add (cake / pizza / pastry / etc (name) : Cake
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
Which type of Dish you want to add (cake / pizza / pastry / etc (name) : Cake
press 8 - to Exit
Enter the Code of the Dish whose ingredients/flavour you want to Change : 104
😎😄😎😄😎😄😎😄😎😄😎😄😎😄😎😄
INGREDIENTS UPDATED......!!
😎😄😎😄😎😄😎😄😎😄😎😄😎😄😎😄
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
104 cold drinks Coke 168.0 100.0
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
Dish Found......!!
😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
Dish Deleted......!!
😒😒😒😒😒😒😒😒😒😒😒😒😒😒😒😒😒😒😒😒
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
Price of Dish is : 30
😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣
press 8 - to Exit
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
--------------------------------------------------------------------------------------------------------------------------------------
---------------------
😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃😇🙃
press 8 - to Exit
**********************************************************************************
*************
🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁
🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁
Try Again......!!!
🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁
🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁🥳🎁
Bibliography
� Books :
• www.wikipedia.org
• www.python.org