Professional Documents
Culture Documents
CAFÉ VIDHYARATHI
(Pallavi Sharma)
PGT Comp Sci
Master IC
EXAMINER:
NAME:
SIGN :
AKNOWLEDGEMENT
Apart from the efforts of me, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in the successful completion of
this project. I express deep sense of gratitude to almighty God for giving me strength
for the successful completion of the project. I express my heartfelt gratitude to my
parents for constant encouragement while carrying out this project. I gratefully
acknowledge the contribution of the individuals who contributed in bringing this
project up to his level, who continues to look after me despite my flaws, I express my
deep sense of gratitude to the luminary The Principal, Army public school who has
been continuously motivating and extending their helping hand to us. I express my
sincere thanks to the academician The Vice Principal, Army public school or constant
encouragement and the guidance provided during this project am overwhelmed to
express my thanks to The Administrative Officer for providing me an infrastructure
and moral support while carrying out this project in the school. My sincere thanks to
Mrs. Pallavi Sharma, Master Incharge, A guide, Mentor all the above a friend, who
critically reviewed my project and helped in solving each and every problem, occurred
during implementation of the project. The guidance and support received from all the
members who contributed and who are contributing to this project, was vital for the
success of the project. I am grateful for their constant support and help
import mysql.connector
def chemist_shop()
f=mysql.connector.connect(host='localhost',user='root',passwd='321')
b=f.cursor()
b.execute('CREATE DATABASE CHEMIST SHOP')
f.commit()
f=mysql.connector.connect(host='localhost',user='root',passwd='321')
b=f.cursor()
b.execute('CREATE DATABASE CUSTOMERS')
f.commit()
f=mysql.connector.connect(host="localhost",user='root',passwd='321',dat
abase='CHEMIST SHOP')
'''b=f.cursor()
b.execute('CREATE TABLE MIDICINES(SNO int(3),NAME
CHAR(20),PRICE int(5));')'''
c=mysql.connector.connect(host='localhost',user='root',passwd='321',data
base='CUSTOMERS')
q=f.cursor()
l=0
while l==0:
print()
print("1.add new record")
print("2.delete a record")
print("3.update a record")
print("4.search a record")
print("5.display all record")
print("6.placing a order and Bill calculation")
print("7.exit")
cc=int(input("enter the no. of your choice "))
print()
if(cc==1):
i=[]
r1=int(input("enter sno. "))
i.append(r1)
r2=input("enter item ")
i.append(r2)
r3=int(input("enter price "))
i.append(r3)
R=("insert into MEDICINES values(%s,%s,%s)")
q.execute(R,i)
c.commit()
elif(cc==2):
i=input("name of item u want to remove ")
R=("delete from MEDICINES where name='{}'".format(i))
q.execute(R)
c.commit()
elif(cc==3):
i=input("enter the item which u want to update ")
r1=input("enter the new name of item ")
r2=int(input("enter the price "))
R=("update MEDICINES set name='{}',price={} where
name='{}'".format(r1,r2,i))
q.execute(R)
c.commit()
elif(cc==4):
i=input("enter the item name u want to search ")
R=("select*from MEDICINES where name=%s")
v=(i,)
q.execute(R,v)
r=q.fetchall()
for i in r:
print(i)
elif(cc==5):
q.execute("select * from MEDICINES order by sno")
R=q.fetchall()
print(' '+'_'*32)
print("%s%-6s%-19s%-4s%2s"%('|','sno.','|item','|price','|'))
print('|'+'_'*6+'|'+'_'*18+'|'+'_'*6+'|')
for i in R:
print("%s%-6s%-19s%-4s%4s"%
('|',str(i[0]),'|'+str(i[1]),'|'+str(i[2]),'|'))
print('|'+'_'*6+'|'+'_'*18+'|'+'_'*6+'|')
elif(cc==6):
print()
print(" To Order a MEDICINES")
q.execute("select * from MEDICINES order by sno")
R=q.fetchall()
print(' '+'_'*32)
print("%s%-6s%-19s%-4s%2s"%('|','sno.','|name','|price','|'))
print('|'+'_'*6+'|'+'_'*18+'|'+'_'*6+'|')
for i in R:
print("%s%-6s%-19s%-4s%4s"%
('|',str(i[0]),'|'+str(i[1]),'|'+str(i[2]),'|'))
print('|'+'_'*6+'|'+'_'*18+'|'+'_'*6+'|')
print()
print()
hh=0
gg=0
while(hh==0):
t=int(input("enter the MEDICINES no u want to purchase "))
R="select * from MEDICINES where sno=%s"
p=(t,)
q.execute(R,p)
r=q.fetchall()
for j in r:
print(j)
z=int(j[2])
print()
qty=int(input("HOW MANY: "))
total=qty*z
print()
print("total price is ",total)
print()
gg=gg+total
hh=int(input("do u want to ORDER more ? press 0 to continue
or 1 to exit"))
print()
print("Final amount of ORDER",gg)
print()
elif(cc==7):
('exit')
l=l+1
else:
print("choose choices from 1 to 7 ")
chemist_shop()
OUTPUT
============================= RESTART: C:\Users\Erose\AppData\
Local\Programs\Python\Python311\ff.py
=============================
Chemist_shop()
enter sno. 1
enter item COUGH SYRUP
enter price 280
enter sno. 2
enter item NIMESULIDE
enter price 245
enter sno. 3
enter item PARACETAMOL
enter price 280
enter sno. 4
enter item ASPIRIN
enter price 345
enter sno. 5
enter item ATENOLOL
enter price 415
________________________________
|sno. |item |price |
|______|__________________|______|
|1 | COUGH SYRUP |280 |
|______|__________________|______|
|2 | NIMESULIDE |245 |
|______|__________________|______|
|3 | PARACETAMOL |280 |
|______|__________________|______|
|4 | ASPIRIN |345 |
|______|__________________|______|
|5 | ATENOLOL |415 |
|______|__________________|______|
________________________________
|sno. |item |price |
|______|__________________|______|
|1 | COUGH SYRUP |280 |
|______|__________________|______|
|2 | NIMESULIDE |245 |
|______|__________________|______|
|3 | PARACETAMOL |280 |
|______|__________________|______|
|4 | ASPIRIN |345 |
|______|__________________|______|
|5 | ATENOLOL |415 |
|______|__________________|______|
________________________________
|sno. |item |price |
|______|__________________|______|
|1 | COUGH SYRUP |280 |
|______|__________________|______|
|2 | NIMESULIDE |245 |
|______|__________________|______|
|3 | Acetaminophen |280 |
|______|__________________|______|
|4 | ASPIRIN |345 |
|______|__________________|______|
|5 | ATENOLOL |415 |
|______|__________________|______|
1.add new record
2.delete a record
3.update a record
4.search a record
5.display all record
6.placing a order and Bill calculation
7.exit
enter the no. of your choice 4
enter the item name u want to search ASPIRIN
(5, ' ASPIRIN, 415)
To Order a BEVERAGE
________________________________
|sno. |item |price |
|______|__________________|______|
|1 | COUGH SYRUP |280 |
|______|__________________|______|
|2 | NIMESULIDE |245 |
|______|__________________|______|
|3 | Acetaminophen |280 |
|______|__________________|______|
|4 | ASPIRIN |345 |
|______|__________________|______|
|5 | ATENOLOL |415 |
|______|__________________|______|
enter the BEVERAGE no u want to purchase 2
(2, ' NIMESULIDE ', 245)