0% found this document useful (0 votes)
1K views2 pages

Python Half Source Code

The document describes a bakery management system using Python and MySQL. It defines tables to store information on items, varieties of cake, and workers. It connects to a MySQL database called 'bakery' and populates the tables with initial data if they are empty. It then provides an interactive menu for admins to manage the bakery database by adding/viewing items, varieties, and workers or updating item costs and worker salaries.

Uploaded by

Me- Lucifer6648
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views2 pages

Python Half Source Code

The document describes a bakery management system using Python and MySQL. It defines tables to store information on items, varieties of cake, and workers. It connects to a MySQL database called 'bakery' and populates the tables with initial data if they are empty. It then provides an interactive menu for admins to manage the bakery database by adding/viewing items, varieties, and workers or updating item costs and worker salaries.

Uploaded by

Me- Lucifer6648
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

#BAKERY MANAGEMENT SYSTEM

import [Link]

con=[Link](host='localhost',user='root',password='admin')

cur=[Link]()
[Link]("create database if not exists bakery")
[Link]("use bakery")
[Link]("create table if not exists items(sno int,products varchar(20),cost
int)")
sql="select*from items"
[Link](sql)
res=[Link]()
if res==[]:
[Link]("insert into items values(1,'Cake',250)")
[Link]("insert into items values(2,'Pastry',70)")
[Link]("insert into items values(3,'Milk',60)")
[Link]("insert into items values(4,'Butter',20)")
[Link]("insert into items values(5,'Cheese',30)")
[Link]()

[Link]("create table if not exists variant(Sno int,Varieties varchar(20))")


sql="select*from variant"
[Link](sql)
res=[Link]()
if res==[]:
[Link]("insert into variant values(1,'Vanilla')")
[Link]("insert into variant values(2,'Chocolate')")
[Link]("insert into variant values(3,'Red velvet')")
[Link]("insert into variant values(4,'Cheesecake')")
[Link]()
[Link]("create table if not exists worker(Sno int,Name varchar(20),Salary
int)")
sql="select*from worker"
[Link](sql)
res=[Link]()
if res==[]:
[Link]("insert into worker values(1,'Mukesh',20000)")
[Link]("insert into worker values(2,'Suresh',12000)")
[Link]("insert into worker values(3,'Vinay',15400)")
[Link]("insert into worker values(4,'Raju',22000)")
[Link]()

from datetime import datetime

print("....................CLASS 12 IP PROJECT....................")
print("___________________________________________________________")
print("|..........................WELCOME..........................|")
print("|............................TO.............................|")
print("|................BAKERY MANAGEMENT SYSTEM..................|")
print("|...................Made By: Preksha Madur..................|")
print("|..............Submitted to: Anjali Patel Mam...............|")
print("|.....................SESSION:2023-2024.....................|")
print("_____________________________________________________________")

ch=''
while ch!='N' or ch!='n':
print("\n\nPLEASE CHOOSE\n1 FOR ADMIN\n2 FOR COSTUMER\n3 FOR EXIT:\n")

choice=int(input("Enter your choice:"))


if choice==3:
break
if choice==1:
admin=input("USERNAME:")
password=int(input("ENTER PASSWORD:"))
if password==admin:
print("*****HELLO,You logged in as Admin successfully*****")
print("______________________________________________________")
print("Press 1 To Add Items in the shop....")
print("Press 2 To See Items in the shop....")
print("Press 3 To Update cost of any Item....")
print("Press 4 To Add Varieties of cake in the shop....")
print("Press 5 To Add Worker in the shop....")
print("Press 6 To See Worker in the shop....")
print("Press 7 To Update Salary of any worker:")

You might also like