









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










con=mysql.connector.connect(host='localhost',user='root',password='12345') cur=con.cursor() cur.execute("create database if not exists items") cur.execute("use items") cur.execute("create table if not exists cs(sno int,products varchar(20),cost int)") sql="selectfrom cs" cur.execute(sql) re=cur.fetchall() if res==[]: cur.execute("insert into cs values(1,'cake',50)") cur.execute("insert into cs values(2,'pastry',20)") cur.execute("insert into cs values(3,'milk',60)") cur.execute("insert into cs values(4,'butter',20)") cur.execute("insert into cs values(5,'cheese',30)") con.commit() cur.execute("create table if not exists vip(sno int,varieties varchar(20))") sql="selectfrom vip" cur.execute(sql) res=cur.fetchall() if res==[]: cur.execute("insert into vip values(1.'vaniella')") cur.execute("insert into vip values(2,'chocolate')") cur.execute("insert into vip values(3,'strawberry')") cur.execute("insert into vip values(4,'butter_scrotch')") con.commit()
cur.execute("create table if not exists worker(sno int,name varchar(20),salary int)") sql="select*from worker" cur.execute(sql) res=cur.fetchall() if res==[]: cur.execute("insert into worker values(1,'mukesh',12364)") cur.execute("insert into worker values(2,'ram',1234)") cur.execute("insert into worker values(3,'suresh',23459)") cur.execute("insert into worker values(4,'rajut',8987)") con.commit() from datetime import datetime print("____________________##CLASS 12th CS PROJECT(083)##_________________________") print("___________________________________________________________________________") print("I.....................................@@@@@@@@@WELCOME@@@@@@@@@.....................................I ") print("I........................................@@@@@@@@@@TO@@@@@@@@@@......................................... I") print("I.................................................BAKERY MANAGEMENT SYSTEM.....................................................I") print("I.....................................................Made by: Aayush kumar mehta..........................................................I") print("I..........................................................Submitted To:Mrs. Deepali............................................................I") print("I...........................................................Session:2022- 2023......................................................................I") print("I__________________________________________________________________________I")
cost=int(input("enter the cost:")) d1=(sno,product 1,cost) s1='insert into cs values(%8,%8,%8)' cur.execute(s1,d1) con.commit() print('.......................////////////////////////// ITEM ADD SUCCESSFULLY \\\\\\\\\\....................') add() elif c==2: def items(): print("items in the shop:") sql="selectfrom cs" cur.execute(sql) res=cur.fetchall() t=(['serial_no','products','cost']) for serial_no,productts,cost in res: print(serial_no,":","\t",products,":\t\t",'cost',cost) items() elif c==3: def money(): sno=input("enter the sno of products:") n_cost=input("enter the rupees to be added:") cur.execute("update cs set cost=cost+"+n_cost+"where sno="=sno+':') con.commit() print("TABLE AFTER UPDATION:") sq="selectfrom cs" cur.execute.fetchall() t=(['sno','products','cost'])
for sno,products,cost in res: print(sno,":","\t",products,":","\t",'cost',cost) money() elif c==4: def variety(): sno=input("enter sno") varieties=input("enter variety:") d2=(sno,varieties) s2='insert into vip values(%8,%8)' cur.execute(s2,d2) con.commit() variety() elif c==5: def ad(): sno=int(input("enter sno")) emp=input("enter name:") salary=int(input("enter the salary:")) dx=(sno,emp,salary) sy='insert into worker values(%8,%8,%8)' cur.execute(sy,dx) con.commit() print("................./////////////////////// WORKER ADD SUCCESSFULLY\\\\\\\\................") ad() elif c==6: def workers(): print("workers in the shop:") sql="select*from worker" cur.execute(sql)
sq="selectfrom worker" cur.execute(sq) res=cur.fetchall() t=(['sno','name','salary']) for sno,name,salary in res: print(sno,":","\t",name,":","\t",'cost',salary) up() else: print("SORRY..You have entered the wrong input,input from 1 to 7") else: print("\t\t\t\t\t*****************Wrong Password****************/t/t/t/t/t") elif choice==2: name=input("enter your name:") phone=int(input("enter your phone bumber:")) print('press1 to see the MENU',sep='.....') print('press2 to order an item') c=int(input('enter your choice:')) if c== def items(): print("items in the shop:") sql="selectfrom cs" cur.execute(sql) res=cur.fetchall() t=(['serial_no','products','cost']) for serial_no,products,cost in res: print(serial_no,":","\t",'cost',cost)
items() elif c==2: print("what do you want to order?") sql="selectfrom cs" cur.execute(sql) res=cur.fetchall() t=(['serial_no','products','cost']) for serial_no,products,cost in res: print(serial_no,":","\t",products,":","\t",'cost',cost) sql="select sno from cs" cur.execute(sql) res=cur.fetchall() print(res) l=[] for i in range(len(res)): lappend(res[i][0]) d=int(input("enter your Serial no of the item to buy:")) if d==1: def items(): print("which cake do you want?") kl="selectfrom vip") cur.execute(kl) srh=cur.fetchall() f=(['sno','varieties']) for sno,varieties in srh: print(sno,":","\t",varieties) print("choose which cake do you want?") ck=int(input("enter choice:"))
print("total amount",qtyL) print("\n") print(".................................................................................................................................") print("YOUR BILL") print("___________________________________________________________") print("costumer's name:",name) print("contact no.:",phone) print("cake type:chocolate") print("no. of cakes:",qty) print("total amount:",qtyL) print("@@@@@@@@THANK_YOU FOR ORDERING THE ITEM@@@@@@@@") print("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\Date:",datetime.now()) if ck==3: print("how much quantity of strawberry cake do you want?") qty=int(input("enter qty:")) print("you have succesfully ordered your cake!!!\t:") cur.execute("selectfrom cs where products='cake'"';') for i in cur: N=i[2] print("total amount",qtyN) print("\n") print(".................................................................................................................................") print("YOUR BILL") print("___________________________________________________________") print("costumer's name:",name)
print("contact no.:",phone) print("cake type:strawberry") print("no. of cakes:",qty) print("total amount:",qtyN) print("@@@@@@@@THANK_YOU FOR ORDERING THE ITEM@@@@@@@@") print("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\Date:",datetime.now()) if ck==4: print("how much quantity of Butter_scotch cake do you want?") qty=int(input("enter qty:")) print("you have succesfully ordered your cake!!!\t:") cur.execute("selectfrom cs where products='cake'"';') for i in cur: M=i[2] print("total amount",qtyM) print("\n") print(".................................................................................................................................") print("YOUR BILL") print("___________________________________________________________") print("costumer's name:",name) print("contact no.:",phone) print("cake type:Butter_scotch") print("no. of cakes:",qty) print("total amount:",qtyM) print("@@@@@@@@THANK_YOU FOR ORDERING THE ITEM@@@@@@@@") print("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\Date:",datetime.now()) items()
print(".................................................................................................................................") print("YOUR BILL") print("___________________________________________________________") print("costumer's name:",name) print("contact no.:",phone) print("quantity of milk:",mlk) print("total amount:",mlkc) print("@@@@@@@@THANK_YOU FOR ORDERING THE ITEM@@@@@@@@") print("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\Date:",datetime.now()) elif d==4: print("how much packetd(20gm) of butter do you want:") past=int(input("enter your choice:")) print("You have succesfully ordered",but,"packets of butter") cur.execute("selectfrom cs where products='butter'"';') for i in cur: c=i[2] print("total amount",butc) print("\n") print(".................................................................................................................................") print("YOUR BILL") print("___________________________________________________________") print("costumer's name:",name) print("contact no.:",phone) print("no. of pastry:",but) print("total amount:",butc)
print("@@@@@@@@THANK_YOU FOR ORDERING THE ITEM@@@@@@@@") print("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\Date:",datetime.now()) elif d==5: print("how much cheese(in kg) do you want:") past=int(input("enter your choice:")) print("You have succesfully ordered",chs,"kg of cheese.") cur.execute("selectfrom cs where products='cheese'"';') for i in cur: c=i[2] print("total amount",chsc) print("\n") print(".................................................................................................................................") print("YOUR BILL") print("___________________________________________________________") print("costumer's name:",name) print("contact no.:",phone) print("no. of pastry:",chs)) print("total amount:",chsc) print("@@@@@@@@THANK_YOU FOR ORDERING THE ITEM@@@@@@@@") print("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\Date:",datetime.now()) elif d in l: qty=int(input("enter qty:")) print("you have succesfully ordered your selected tems!!!\t:") cur.execyte("selectfrom cs where sno="+str(d)) for i in cur: L=i[2]