0% found this document useful (0 votes)
18 views23 pages

Merns

Uploaded by

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

Merns

Uploaded by

Yash Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

B.V.M.

PUBLIC SCHOOL
2024-2025

COMPUTER SCIENCE PROJECT


ON
GROCERY
SHOP
MANAGEMENT

UNDER THE ESTEEMED


GUIDANCE OF

MR GAURAV SHARMA, CS FACULTY

BY
Anand Kumar Singh
XII G
B.V.M. Public School

CERTIFICATE
The project report entitled
“Grocery store management "
Submitted by Anand Kumar Singh of class XIIG for the cbse senior
secondary examination class XII of Computer Science at BVM Public
School, Najafgarh New Delhi.

The original research work is carried out by me under my


supervision in the academic year 2024-25. On the basis of dedication
made by me I recommend this project report for evaluation.

Certified by: Examiner signature

GAURAV SHARMA
Acknowledgement
I want to convey my heartfelt gratitude to my professor Mr.
Gaurav Sharma for their support and encouragement during the
research and writing of this history project. Their expertise in the
subject matter greatly contributed to the depth and quality of the
project.
Also, I would like to express my sincere gratitude to our Principal
Praveen Sharma for his unwavering support and encouragement
throughout this project. I am grateful for the opportunity to have
worked on this project under his guidance, and I am confident
that my learning and personal growth have been enriched as a
result.
Introduction
A Grocery store management system is the system where all the
aspects related to the proper management of grocery store are
done. These aspects involve managing information about the
varied products, staff, managers, Customers, billing, etc. This
system provides an efficient way of managing grocery store
information. Also allows the Customer to get and buy the things
purchased.
This project is based on the sales transaction and billing of items
in a grocery store. The first activity is based on adding the items to
the system along with the rate which is present in the grocery
store and the name of the items which the grocery store will
agree to sell. This authority is given only to the admin
(administrator). Any modifications to be wiped out the item name
and therefore the rate is often done only by admin. He also has
the proper to delete any item. As the customer buys the products
and involves the billing counter, the user is meant to enter the
item name he purchased and therefore the quantity of the item
he had purchased. This is not an enormous task.
This study is to produce software that manages the sales activity
done in a grocery store, maintaining the stock details, and
maintaining the records of the sales done for a particular
month/year. The users will consume less time in calculation and
therefore the sales activities are going to be completed within a
fraction of seconds whereas manual system will make the user
write it down which is a long procedure and so paperwork will be
reduced and the user can spend more time on the monitoring the
grocery store. The project is going to be user-friendly and
straightforward to use.
The system will display all the with things whose name starts with
the letter selected by the user. He can select out or those
displayed. Finally, a separate bill is going to be generated Tor
every customer. This will be saved in the database. Any periodic
records are often viewed at any time. Admin provides a singular
username and password for every employee through which he
can log in.
Purpose
The purpose of the Grocery Store Management System is to
automate the existing manual system with the help of
computerized equipment and full-fledged computer software,
fulfilling their requirements, so that their valuable
data/information are often stored for an extended period with
easy accessing and manipulation of the same. The required
software and hardware are easily available and straightforward to
figure with Grocery Store Management System, as described
above, can lead to an error-free, secure, reliable, and fast
management system. It can assist the user to consider their other
activities rather than consider the record keeping. Thus, it'll help
organizations in better utilization of resources. It is possible for
organizations to maintain computerized duplication. In other
words, one does not have to be distracted by irrelevant
information in order to succeed in the knowledge.
Data structure
Customer table
•Entity name:customer
•Primary key: cust_id
•Description: details about customer
Field Data type Constraints
cust_name varchar(20) Not null
cust_mob int
cust_email varchar(35)
cust_id varchar (20) primary key
cust_add varchar (40)
 Worker table
• Entity name: worker
• Primary key: work_id
• Description: details about worker in shop
Field Data type Constraints
work_name varchar(20) Not null
work_id varchar(20) Primary key
work_dept varchar(20)
work_mobile int
work_email varchar(20)
 Product table
• Entity name: Products
• Primary key: prod_id
• Description: details about all the product
Field Data type Constraints
prod_id int primary key
prod_name varchar (30) not null
prod_code int
prod_type varchar (30) not null
prod_cost int
CUSTOMER MODULE:
import mysql.connector as customer

mydb = customer.connect(host="localhost", user="root", passwd="", database="myshop")

if mydb.is_connected() == False:

print("Error in connecting database")

else:

cur = mydb.cursor()

def add_customer():

cust_name = input("Enter the customer's name: ")

cust_mobile = int(input("Enter the mobile number of customer: "))

cust_email = input("Enter the email id of the customer: ")

cust_id=int(input("Enter the customer's id provided: "))

cust_add = input("Enter customer's delivery address: ")

t="INSERT INTO CUSTOMER VALUES('{0}', {1}, '{2}', {3}, '{4}')"

query=t.format(cust_name, cust_mobile, cust_email, cust_id, cust_add)

def search_customer():

a = int(input("Enter the customer's id you want to know about: "))

query = "SELECT FROM CUSTOMER WHERE CUST_ID=%s" % (a,)

cur.execute(query)

data=cur.fetchone()

if data==None:

print("No record found")

else:

print("customer's name:", data[0])

print("customer's ID:", data[1])

print("customer's mobile number:", data[2])

print("customer's email id:", data[3])

print("customer's delivery address:", data[4])

def display_customer():

query = "SELECT * FROM CUSTOMER"

cur.execute(query)

data = cur.fetchall()
if not data:

print("No records are there!!")

else:

for i in data:

print("customer's name:", i[0])

print("customer's ID:", i[1])

print("customer's mobile number:", i[2])

print("customer's email id:", i[3])

print("customer's delivery address:", i[4] )

def delete_customer():

x=int(input("Enter the customer's id you want to delete record of: "))

query = "SELECT * FROM CUSTOMER WHERE CUST_ID=%s" % (x,)

cur.execute(query)

data=cur.fetchone()

if data==None:

print("No record found")

else:

print(data)

c = input("Do you want to delete this record y/n: ")

if c.lower() == "y":

query = "DELETE FROM CUSTOMER WHERE CUST_ID='{}".format(x)

cur.execute(query)

mydb.commit()

print("Record deleted successfully!!")

else:

print("Task aborted")

def modify_customer():

j=int(input("Enter the customer's ID whose record you want to modify: "))

query = "SELECT FROM CUSTOMER WHERE CUST_ID=%s" % (j,)

cur.execute(query)

d=cur.fetchone()

if d==None:

print("Record not found")


else:

print(d)

o=input("Do you want to modify this record y/n: ")

if o.lower()=="y":

id=input("Enter the new ID of the customer or press enter to skip: ")

if id!="":

query= "UPDATE CUSTOMER SET CUST_ID={} WHERE CUST_ID={}".format(id, j)

cur.execute(query)

name = input("Enter the new name of the customer or press enter to skip: ")

if name !="":

query = "UPDATE CUSTOMER SET CUST_NAME ='{}' WHERE CUST_ID={}".format(name,j)

cur.execute(query)

addres=input("Enter the new delivery address of the customer or press enter to skip: ")

if addres !="":

query = "UPDATE CUSTOMER SET CUST_ADD='{}' WHERE CUST_ID={}".format(addres,j)

cur.execute(query)

mobile_no=input("Enter the new mobile number of the customer or press enter to skip: ")

if mobile_no != '':

query="UPDATE CUSTOMER SET CUST_MOBILE ={} WHERE CUST_ID={}".format(mobile_no, j)

cur.execute(query)

email = input("Enter the new email id of the customer or press enter to skip: ")

if email !="":

query = "UPDATE CUSTOMER SET CUST_EMAIL='{}' WHERE CUST_ID={}".format(email,j)

cur.execute(query)

mydb.commit()

print('Record modified succesfully')

else:

print('Task aborted!!')
WORKER MODULE
import mysql.connector as worker

mydb = worker.connect(host="localhost", user="root", passwd="", database="myshop")

if mydb.is_connected() == False:

print("Error in connecting database")

else:

cur = mydb.cursor()

def add_worker():

work_name = input("Enter the worker's name: ")

work_id = int(input("Enter the worker's id: "))

work_dept = input("Enter the department of the worker: ")

work_mobile = int(input("Enter the mobile number of worker: "))

work_email = input("Enter the worker's email id: ")

query = "INSERT INTO WORKER VALUES('{0}', {1},'{2}',


{3},'{4}')".format(work_name,work_dept, work_mobile, work_email)

cur.execute(query)

mydb.commit()

def search_worker():

a = int(input("Enter the worker's id you want to know about: "))

query = "SELECT * FROM WORKER WHERE WORK_ID=%s" % (a,)

cur.execute(query)

data=cur.fetchone()

if data==None:

print("No record found")

else:

print("worker's name:", data[0] )

print("worker's ID:", data[1] )

print("worker's dept:", data[2] )

print("worker's mobile number:", data[3] )

print("worker's email id:", data[4])

def display_worker():

query = "SELECT * FROM WORKER"


cur.execute(query)

data = cur.fetchall()

if not data:

print("No records are there!!")

else:

for i in data:

print("worker's name:", i[0])

print("worker's ID:", i[1])

print("worker's dept:", i[2])

print("worker's mobile number:", i[3])

print("worker's email id:", i[4])

def delete_worker():

x=int(input("Enter the worker's id you want to delete record of: "))

query= "SELECT FROM WORKER WHERE WORK_ID=%s" % (x,)

cur.execute(query)

data=cur.fetchone()

if data==None:

print("No record found")

else:

print(data)

c=input("Do you want to delete this record y/n: ")

if c.lower() == "y":

query = "DELETE FROM WORKER WHERE WORK_ID='{}'".format(x)

cur.execute(query)

mydb.commit()

print("Record deleted successfully!!")

else:

print("Task aborted")

def modify_worker():

j = int(input("Enter the worker's ID whose record you want to modify: "))

query = "SELECT * FROM WORKER WHERE WORK_ID=%s" % (j,)

cur.execute(query)

d = cur.fetchone()
if d==None:

print("Record not found")

else:

print(d)

o = input("Do you want to modify this record y/n: ")

if o.lower() == "y":

id = input("Enter the new ID of the worker or press enter to skip: ")

if id != "":

query = "UPDATE WORKER SET WORK_ID={} WHERE WORK_ID={}".format(id,j)

cur.execute(query)

name = input("Enter the new name of the worker or press enter to skip: ")

if name != "":

query = "UPDATE WORKER SET WORK_NAME='{}' WHERE WORK_ID={}".format(name,j)

cur.execute(query)

dept=input("Enter the new department of the worker or press enter to skip: ")

if dept != "":

query="UPDATE WORKER SET WORK_DEPT='{}' WHERE WORK_ID={}".format(dept, j)

cur.execute(query)

mobile_no=input("Enter the new mobile number of worker or press enter to skip: ")

if mobile_no != "":

query="UPDATE WORKER SET WORK_MOBILE ={} WHERE WORK_ID={}".format(mobile_no, j)

cur.execute(query)

email=input("Enter the new email id of the worker or press enter to skip: ")

if email != "":

query = "UPDATE WORKER SET WORK_EMAIL ='{}' WHERE ID ={}".format(email,j)

cur.execute(query)

mydb.commit()

print("Record modified successfully!!")

else:

print("Task aborted!!")
PRODUCT MODULE
import mysql.connector as unknown

mydb = unknown.connect(host="localhost", user="root", passwd="", database="myshop")

if mydb.is_connected()==False:

print("Error in connecting database")

else:

cur=mydb.cursor()

def add_product():

prod_name = input("Enter the product's name:")

prod_code = int(input("Enter the product's code:"))

prod_type = input("Enter the type of product:")

prod_cost = int(input("Enter the product's cost:"))

query = "INSERT INTO PRODUCT VALUES('{0}', {1}, '{2}', {3})".format(prod_name,


prod_code,prod_type, prod_cost)

cur.execute(query)

mydb.commit()

def search_product():

a= int(input("Enter the product's code you want to know about:"))

query = "SELECT * FROM PRODUCT WHERE PROD_CODE=%s" % (a,)

cur.execute(query)

data=cur.fetchone()

if data==None:

print("No record found")

else:

print("product's name-", data[0])

print("product's code-", data[1])

print("product's type-", data[2])

print("product's cost-", data[3])

def display_product():

query="SELECT FROM PRODUCT"

cur.execute(query)

data=cur.fetchall()
if not data:

print("No records are there!!")

else:

for i in data:

print("product's name= ",i[0])

print("product's code= ", i[1])

print("product's type= ", i[2])

print("product's cost= ", i[3])

def delete_product():

x = int(input("Enter the product's code you want to delete record of:"))

query= "SELECT FROM PRODUCT WHERE PROD CODE=%s" % (x,)

cur.execute(query)

data = cur.fetchone()

if data==None:

print("No record found")

else:

print(data)

c=input("Do you want to delete this record y/n: ")

if c.lower()=="y":

query="DELETE FROM PRODUCT WHERE PROD_CODE='{}'".format(x)

cur.execute(query)

mydb.commit()

print("Record deleted successfully!!")

else:

print("Task aborted")

def modify_product():

j=int(input("Enter the product's code whose record you want to modify:"))

query="SELECT FROM PRODUCT WHERE PROD_CODE=%s"%(j,)

cur.execute(query)

d=cur.fetchone()

if d==None:

print("Record not found")

else:
print(d)

o=input("Do you want to modify this record y/n: ")

if o.lower()=="y":

code=input("Enter the new code of the PRODUCT or press enter to skip:")

if code !="":

query="UPDATE PRODUCT SET PROD CODE={} WHERE PROD_CODE={}".format(code,j)

cur.execute(query)

name=input("Enter the new name of the PRODUCT or press enter to skip:")

if name !="":

query="UPDATE PRODUCT SET PROD_NAME='{}' WHERE PROD_CODE={}".format(name, j)

cur.execute(query)

type_=input("Enter the new type of the PRODUCT or press enter to skip:")

if type_!="":

query="UPDATE PRODUCT SET PROD type='{}' WHERE PROD_CODE={}".format(type_,j)

cur.execute(query)

cost=input("Enter the new cost of the PRODUCT or press enter to skip:")

if cost !="":

query="UPDATE PRODUCT SET PROD_COST-() WHERE PROD_CODE={}".format(cost,j)

cur.execute(query)

mydb.commit()

print("Record modified successfully!!")

else:

print("Task aborted!!")
~~~~~~~~~~~MENU PROGRAM~~~~~~~~~~~
import product as p

import worker as w

import customer as c

print("="*100)

print("~"*100)

print("~~~~~~~~~~~~~~~~~~~ MY GROCERY STORE ~~~~~~~~~~~~~~~~")

print("~"*100)

print("="*100)

while True:

main=input("Press ENTER to enter in the main menu:")

if main=="":

print("1.Customer's menu")

print("2.Product's menu")

print("3.Worker's menu")

print("4. Return to the previous menu")

ch=int(input("enter your choice"))

if ch ==1:

print("~~~~~~~~~~~~~~~~~~~CUSTOMER'S MENU~~~~~~~~~~~~~~~~~~~~~~~~~")

print("1. To add a new customer")

print("2. To display all the customer's information")

print("3. To search the record of a customer")

print("4. To delete a customer's record")

print("5. To modify a customer's record")

print("6. To go back to the previous menu ")

y=int(input("Enter you choice:"))

if y==1:

c.add_customer

elif y==2:

c.display_customer

elif y==3:

c.search_customer
elif y==4:

c.delete_customer

elif y==5:

c.modify_customer

elif y==6:

break

else:

print("PLEASE ENTER THE CORRECT CHOICE!!")

elif ch==2:

print(" ~~~~~~~~~~~~~~~~~~~~~PRODUCT'S MENU~~~~~~~~~~~~~~~")

print("1. To add a new product")

print("2. To display all the product's information")

print("3. To search the record of a product")

print("4. To delete a product's record")

print("5. To modify a product's record")

print("6. To go back to the previous menu ")

y=int(input("Enter you choice:"))

if y==1:

p.add_product

elif y == 2:

p.display_product

elif y == 3:

p.search_product

elif y==4:

p.delete_product

elif y == 5:

p.modify_product

elif y == 6:

break

else:

print("PLEASE ENTER THE CORRECT CHOICE!!")

elif ch==3:

print("~~~~~~~~~~~~~~WORKER'S MENU~~~~~~~~~~~~~~")
print("1. To add a new worker")

print("2. To display all the worker's information")

print("3. To search the record of a worker")

print("4. To delete a worker's record")

print("5. To modify a worker's record")

print("6. To go back to the previous menu ")

y=int(input("Enter you choice:"))

if y==1:

w.add_worker

elif y==2:

w.display_worker

elif y==3:

w.search_product

elif y==4:

w.delete_product

elif y==5:

w.modify_worker

elif y==6:

break

else:

print("PLEASE ENTER THE CORRECT CHOICE!!")

elif ch==4:

print("RETURNING OUT")

break

else:

print("PLEASE ENTER THE CORRECT CHOICE")

print("="*110)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mysql> show databases;

+----------------+

|Database |

|----------------|

|myshop |

|mysql |

|groceryshop_mng |

+----------------+

8 rows in set (0.00 sec)

mysql> use myshop;

Database changed

mysql> select * from customer;

+----------+-------------+-----------------+---------+---------------------------------------+

|cust_name | cust_mobile | cust_email | cust_id |cust_add |

+----------+-------------+-----------------+---------+---------------------------------------+

|rohan |45634634 |[email protected] | 1|new delhi |

|ajay |653434543 |[email protected] | 2|sampla village,haryana |

|vikas |145634635 |[email protected] | 3|delhigate, najafgarh, newdelhi |

|jagriti |145635 |[email protected]| 4|keshopur village, vikaspuri, newdelhi |

|sonu |754646 |[email protected] | 5|punjabi bagh, new delhi |

+----------+-------------+-----------------+---------+---------------------------------------+

5 rows in set (0.00 sec)


mysql> select from worker;

+----------+-------+---------+-------------+----------------+

|work_name |work_id|work_dept| work_mobile | work_email |

|-----------+-------+---------+-------------+---------------+

|monu | 1 |a |89217198 |[email protected] |

|ram | 2 |b |9182399 |[email protected] |

|shyam | 3 |a |78219898 |[email protected]|

|gyan | 4 |c |7837189 |[email protected] |

|rohit | 5 |d |1828938 |[email protected]|

+-----------+-------+---------+-------------+---------------+

5 rows in set (0.00 sec)

mysql> select from product;

+---------+----------+------------+---------+

|prod_name| prod_code| prod_types |prod_cost|

+---------+----------+------------+---------+

|apple | 1 |fruits |20 |

|butter | 2 |dairy |50 |

|egg | 3 |dairy |10 |

|chicken | 4 |meat |500 |

|cheese | 5 |dairy |40 |

|bacon | 6 |meat |500 |

+---------+----------+------------+---------+

6 rows in set (0.00 sec)

You might also like