Physics Project
Physics Project
NO.2
SALT LAKE
AN INVESTIGATORY
PROJECT ON COMPUTER
SCIENCE
SESSION 2023-24
GROCERY MANAGEMENT
Submitted by:
Anushka srivastava
Angelina das
Abhinav balaji
CERTIFICATE
-Anushka srivastava
INDEX
2. Topic II
3. Certificate III
4. Acknowledgement IV
5. Introduction VI
6. Hardware VIII
requirements
7. Software IX
requirements
8. Code X
9. Output XVII
TIME CONSUMING
EASY TO USE
AFFORDABLE
FULLY AUTOMATIC
HARDWARE REQUIREMENTS
4 GB RAM
CPU@3.10Hz
OS- windows 11
Python 3.11
MySQL
CODE
import mysql.connector as sql
conn=sql.connect(host="localhost",user="root",pass
wd="anushka12a",database="grocery_shop")
if conn.is_connected():
print('successfully connected')
mycursor=conn.cursor()
print('GROCERY MANAGEMENT SYSTEM')
print('1.LOGIN')
print('2.EXIT')
choice=int(input('Enter your choice:'))
if choice==1:
user_name=input("Enter user name:")
password=int(input("Enter password:"))
while True:
print('CONNECTED SUCCESFULLY')
print('GROCERY SHOP')
print('1.Customer Details')
print('2.Product details')
print('3.Worker details')
print('4.See all customer details')
print('5.See all product details')
print('6.See all worker details')
print('7.See one customer details')
print('8.See one product details')
print('9.See one worker details')
choice=int(input('enter the choice:'))
choice=int(input('enter the choice:'))
if choice==1:
cust_name=input('Enter your name=')
phone_no=int(input('Enter your phone
number='))
cost=float(input('Enter your cost='))
q1='INSERT INTO customer_details7
VALUES("{}",{},{})'.format(cust_name,phone_no,cost)
mycursor.execute(q1)
conn.commit()
print("Data added succesffuly")
elif choice==2:
product_name=input('Enter Product name=')
product_cost=float(input('Enter the cost='))
q2='INSERT INTO product_details7
VALUES("{}",{})'.format(product_name,product_cost)
mycursor.execute(q2)
conn.commit()
print("Data is updated")
elif choice==3:
worker_name=input('Enter your name=')
worker_work=input("Enter your work=")
worker_age=int(input('Enter your AGE='))
worker_salary=float(input('Enter your salary='))
phone_no=int(input('Enter your phone
number='))
q3='INSERT INTO worker_details7
VALUES("{}","{}",{},{},
{})'.format(worker_name,worker_work,worker_age,wor
ker_salary,phone_no)
mycursor.execute(q2)
conn.commit()
print("Data is updated")
elif choice==4:
t=conn.cursor()
t.execute('SELECT * FROM customer_details7')
record=t.fetchall()
for i in record:
print(i)
elif choice==5:
t=conn.cursor()
t.execute('SELECT * FROM product_details7')
record=t.fetchall()
for i in record:
print(i)
elif choice==6:
t=conn.cursor()
t.execute('SELECT * FROM worker_details7')
record=t.fetchall()
for i in record:
print(i)
elif choice==7:
t=conn.cursor()
a=input("Enter the name you want to view:")
t.execute('SELECT * FROM customer_details7
WHERE cust_name=("{}")'.format(a))
v=t.fetchall()
for i in v:
print(i)
elif choice==8:
t=conn.cursor()
a=input("Enter the product name you want to
view:")
t.execute('SELECT * FROM product_details7
WHERE product_name=("{}")'.format(a))
v=t.fetchall()
for i in v:
print(i)
elif choice==9:
t=conn.cursor()
a=input("Enter the worker name you want to
view:")
t.execute('SELECT * FROM worker_details7
WHERE worker_name=("{}")'.format(a))
x=t.fetchall()
for i in x:
print(i)
else:
print("WRONG PASSWORD...,try again")
if choice==2:
con.close()
OUTPUT
CONCLUSION
https//:cbse.gov.in
NCERT computer science class
XII
SUMITA ARORA Class XII