CS Investigatory Project by Gokul
CS Investigatory Project by Gokul
II
NAVAL BASE, KOCHI- 682004
BONAFIDE CERTIFICATE
This is to certify that Mr. GOKUL KRISHNA R of Class XII, Roll
Number 24625564, has completed the investigatory
chemistry project entitled
“Grocery Shop Management System”
during the academic year 2021-22 for the partial fulfilment of
his academic course. The subject matter present in the
project as original and bonafide in nature.
BACK END
It refers to parts of a computer application or a program's
code that allow it to operate and that cannot be accessed
by a user. Most data and operating syntax are stored and
accessed in the back end of a computer system.
FRONT END
The layer above the back end is the front end and it
includes all software or hardware that is part of a user
interface.
DATABASE
Database is a collection of interrelated data to serve
multiple applications, i.e., database programs create files of
information. So, we see that files are worked with most
inside the program itself.
ADVANTAGES :
In order to meet competition, avoid obsolescence, and
seize opportunities. A grocery shop database must be able
to:
Respond rapidly to new or changing information needs.
Maintaining the past data to ensure the alternations
that need to be done
Reduce error
Provide better protection
Make work easier
Reduce manual labor
MAIN PROGRAM:
import mysql.connector as sql
mydb=sql.connect(host='localhost',user='root',passwd='mysql',
database='Grocery_Shop')
if mydb.is_connected():
print('===============Successfully Connected===============')
c=mydb.cursor()
if choice==1:
cust_name=input("Enter your name: ")
phone_no=int(input("Enter your phone number: "))
phone_no_str=str(phone_no)
cost=float(input("Enter the cost: "))
c.execute("insert into customer_details
values('{0}','{1}',
{2})".format(phone_no_str,cust_name,cost))
mydb.commit()
print("Data Successfully Updated.")
elif choice==2:
worker_name=input("Enter your name: ")
worker_work=input("Enter your section: ")
worker_age=int(input("Enter your age: "))
worker_salary=float(input("Enter your salary: "))
phone_no =int(input("Enter your phone number: "))
phone_no_str=str(phone_no)
c.execute("insert into worker_details
values('{0}','{1}',{2},
{3},'{4}')".format(worker_name,worker_work,worker_
age,worker_salary,phone_no_str))
mydb.commit()
print("Data Successfully Updated.")
elif choice==3:
product_name=input("Enter product name: ")
product_cost=float(input("Enter the cost: "))
product_cost_str=str(product_cost)
c.execute("insert into product_details
values('{0}','{1}')".format(product_name,product_c
ost_str))
mydb.commit()
print("Data Successfully Updated.")
elif choice==4:
c.execute("select * from customer_details")
record=c.fetchall()
print("*****Customer Details*****")
for i in record:
print(i)
elif choice==5:
c.execute("select * from worker_details")
record=c.fetchall()
print("*****Worker Details*****")
for i in record:
print(i)
elif choice==6:
c.execute("select * from product_details")
record=c.fetchall()
print("*****Product Details*****")
for i in record:
print(i)
elif choice==7:
name=input("Enter the customer's name whose detail
has to be shown: ")
c.execute("select * from customer_details where
cust_name=('{}')".format(name))
record=c.fetchall()
print("Details of",name,":")
for i in record:
print(record)
elif choice==8:
name=input("Enter worker's name whose detail has
to be shown: ")
c.execute("select * from worker_details where
worker_name=('{}')".format(name))
record=c.fetchall()
print("Details of",name,":")
for i in record:
print(record)
elif choice==9:
name=input("Enter the product's name for which the
details which has to be shown: ")
c.execute("select * from product_details where
product_name=('{}')".format(name))
record=c.fetchall()
print("Details of",name,":")
for i in record:
print(record)
elif choice==10:
name=input("Enter the customer's name whose
details have to be deleted: ")
c.execute("delete from customer_details where
cust_name='{}'".format(name))
mydb.commit()
print("Customer details of",name,"deleted.")
elif choice==11:
name=input("Enter the worker's name whose details
have to be deleted: ")
c.execute("delete from worker_details where
worker_name='{}'".format(name))
mydb.commit()
print("Worker details of",name,"deleted.")
elif choice==12:
name=input("Enter the product's name whose details
have to be deleted: ")
c.execute("delete from product_details where
product_name='{}'".format(name))
mydb.commit()
print("Product details of",name,"deleted.")
elif choice==13:
exit()
else:
print('*****Wrong Password*****')
print('********Try Again********')
if choice==2:
exit()
else:
print("You enetered a wrong choice. Restart the program.")
DATABASE CREATION PROGRAM (if not
created):
MySQL OUTPUT:
ADDING WORKERS’ DETAILS:
PYTHON OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products’ details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 2
Enter your name: Abhimanue
Enter your section: Stationary
Enter your age: 28
Enter your salary: 30000
Enter your phone number: 8547855564
Data Successfully Updated.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products’ details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 2
Enter your name: Athul
Enter your section: Vegetables
Enter your age: 25
Enter your salary: 28000
Enter your phone number: 9495311675
Data Successfully Updated.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products’ details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 2
Enter your name: Mridhul
Enter your section: Snacks
Enter your age: 22
Enter your salary: 35000
Enter your phone number: 7215396421
Data Successfully Updated.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products’ details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 2
Enter your name: Priyanshu
Enter your section: Billing
Enter your age: 26
Enter your salary: 40000
Enter your phone number: 8512647825
Data Successfully Updated.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products’ details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
MySQL OUTPUT:
ADDING PRODUCTS’ DETAILS:
PYTHON OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 3
Enter product name: Pen
Enter the cost: 10
Data Successfully Updated.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 3
Enter product name: Notebook
Enter the cost: 75
Data Successfully Updated.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 3
Enter product name: Tomato
Enter the cost: 50
Data Successfully Updated.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 3
Enter product name: Potato Chips
Enter the cost: 35
Data Successfully Updated.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
MySQL OUTPUT:
DISPLAYNG ALL CUSTOMERS’ DETAILS IN
PYTHON:
OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 4
*****Customer Details*****
('9496225789', 'Arjun', 3000.0)
('9671127051', 'Vivek', 4000.0)
('8129385475', 'Devin', 2500.0)
('9496772815', 'Harishyaam', 3600.0)
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
DISPLAYNG ALL WORKERS’ DETAILS IN
PYTHON:
OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 5
*****Worker Details*****
('Abhimanue', 'Stationary', 28, 30000.0, '8547855564')
('Athul', 'Vegetables', 25, 28000.0, '9495311675')
('Mridhul', 'Snacks', 22, 35000.0, '7215396421')
('Priyanshu', 'Billing', 26, 40000.0, '8512647825')
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
DISPLAYNG ALL PRODUCTS’ DETAILS IN
PYTHON:
OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 6
*****Product Details*****
('Pen', 10.0)
('Notebook', 75.0)
('Tomato', 50.0)
('Potato Chips', 35.0)
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
DISPLAYNG ONE CUSTOMER’S DETAIL IN
PYTHON:
OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 7
Enter the customer's name whose detail has to be shown: Arjun
Details of Arjun :
[('9496225789', 'Arjun', 3000.0)]
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
DISPLAYNG ONE WORKER’S DETAIL IN
PYTHON:
OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 8
Enter worker's name whose detail has to be shown: Mridhul
Details of Mridhul :
[('Mridhul', 'Snacks', 22, 35000.0, '7215396421')]
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
DISPLAYNG ONE PRODUCT’S DETAIL IN
PYTHON:
OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 9
Enter the product's name for which the details which has to be
shown: Potato Chips
Details of Potato Chips :
[('Potato Chips', 35.0)]
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
DELETING A CUSTOMER’S DETAIL:
OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 10
Enter the customer's name whose details have to be deleted:
Vivek
Customer details of Vivek deleted.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
MySQL OUTPUT:
DELETING A WORKER’S DETAIL:
PYTHON OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 11
Enter the worker's name whose details have to be deleted:
Athul
Worker details of Athul deleted.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
MySQL OUTPUT:
DELETING A PRODUCT’S DETAIL:
PYTHON OUTPUT:
===============Successfully Connected===============
================GAV Grocery Store================
Press 1 for logging in.
Press 2 for exiting.
Enter your choice: 1
Enter your username: GAV
Enter your password: gav123
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 12
Enter the product's name whose details have to be deleted:
Tomato
Product details of Tomato deleted.
====================Logged In Successfully====================
GAV Grocery Store
Press 1 for adding customer details.
Press 2 for adding worker details.
Press 3 for adding product details.
Press 4 to see all customers' details.
Press 5 to see all workers' details.
Press 6 to see all products' details.
Press 7 to see one customer's details.
Press 8 to see one worker's details.
Press 9 to see one product's details.
Press 10 to delete a customer's details.
Press 11 to delete a worker's details.
Press 12 to delete a product's details.
Press 13 to exit.
Enter a choice: 13
MySQL OUTPUT:
BIBLIOGRAPHY