0% found this document useful (0 votes)
483 views

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
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
483 views

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
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#BAKERY MANAGEMENT SYSTEM

import mysql.connector

con=mysql.connector.connect(host='localhost',user='root',password='admin')

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

cur.execute("create table if not exists variant(Sno int,Varieties varchar(20))")


sql="select*from variant"
cur.execute(sql)
res=cur.fetchall()
if res==[]:
cur.execute("insert into variant values(1,'Vanilla')")
cur.execute("insert into variant values(2,'Chocolate')")
cur.execute("insert into variant values(3,'Red velvet')")
cur.execute("insert into variant values(4,'Cheesecake')")
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',20000)")
cur.execute("insert into worker values(2,'Suresh',12000)")
cur.execute("insert into worker values(3,'Vinay',15400)")
cur.execute("insert into worker values(4,'Raju',22000)")
con.commit()

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