You are on page 1of 28

SVN COLONY VISAKHAPATNAM ANDHRA PRADESH-07

SUPERMARKET
MANAGEMENT SYSTEM
COMPUTER SCIENCE
INVESTIGATORY PROJECT

SUBMITTED TO: SUBMITTED BY:


MR.SNS KALYAN BHARADWAJ B RITISHA RATHO
Certificate
This is to certify that RITISHA RATHO, a
student of class XII-A has successfully
completed the research on the topic
“Supermarket Management System”,
under the guidance of
Mr.Kalyan Bharadwaj Sir during the
year 2023-2024 in partial fulfilment of
computer science practical examination of
Central Board of Secondary Education
(CBSE)

External Examiner Internal Examiner

Principal
INTRODUCTION
This project work automates
Supermarket Management system.
Supermarket Management System
consist of tasks such entering the items
we needed, inquiry our previous visits
etc.

Data file handling has been effectively used


in the program. Database is a collection of
inter-related data to serve multiple
application i.e. database programs create
files of information. So we see that files are
worked with most inside the program itself.

DATABASE MANAGEMENT SYSTEM [DBMS]


The software required for management of data is called
DBMS. It has three models.
Relation model: It stores information in the form of rows
(cardinality) and columns (degree).
Hierarchical model: In this type of model, we have multiple
records inside a single record.
Network model: In this, the data is represented by
collection of record and relationships are separated by
association.
Characteristics of DBMS:
It reduces the redundancy
Data sharing
Data standardization
Reduction of data inconsistency
Types of files based on access:
Sequential file
Serial file
Random file
Test file
Binary file

SOFTWARE AND HARDWARE REQUIREMENT


#Software Specification:
 Operating system : Windows 11/10/8/7
 Platform : Python Idle 3.10
 Database : My-SQL
 Languages : Python
#Hardware Specifications:
 Processor : Dual Core or above
 Hard Disk : 1TB
 Ram : 4GB
#Advantages of project:
 Saves time of shop workers
 Fast process
 Improving Trading Standards
 Complete Item Automation
 Effortless Bills Management
 Publishing Of Online Advertisement
 Easy Management Of Stock Information
Analytical Reports
 Ordering Items For The Store
Source Code in Python

import mysql.connector as myc


print("""
____________________________________________
Welcome to Ritisha and Bhavya's Supermarket
____________________________________________
""")
con=myc.connect(host="localhost",user="root",password="1234")
c=con.cursor()
c.execute("create database if not exists Supermarket")
c.execute("use Supermarket")
c.execute("create table if not exists Login(Username varchar(25) not
null,password varchar(25) not null)")
c.execute("create table if not exists Purchase(Pur_Date date not
null,Name varchar(25) not null,pcode int not null,amount int not null)")
c.execute("create table if not exists Stock(p_code int not null,p_name
varchar(25) not null,p_quantity int not null,Price int not null)")
con.commit()
z=0
c.execute("select * from Login")
for i in c:
z+=1
if z==0:
c.execute("insert into Login values('Ritisha',4321)")
c.execute("insert into Login values('Bhavya',9876)")
con.commit()
while True:
print("""
1. Admin
2.Customer
3.Exit
""")
ch=int(input("Enter your choice:"))
if ch==1:
Pass=input("Enter password:")
c.execute("select * from Login")
for i in c:
Username,password=i
if Pass==password:
print("Welcome")
loop2="y"
while loop2=="y" or loop2=="Y":
print("""
1. Add New Items
2. Update price
3. Delete Item
4. Display All items
5. Change your password
6. Log Out
""")
ch=int(input("Enter your choice:"))
if ch==1:
loop="y"
while loop=="y" or loop=="Y":
pcode=int(input("Enter product code:"))
pname=input("Enter product name:")
quantity=int(input("Enter Quantity of the product:"))
price=int(input("Enter the price:"))
c.execute("insert into Stock
values('"+str(pcode)+"','"+pname+"','"+str(quantity)+"','"+str(price)+"')")
con.commit()
print("Record entered successfully....")
loop=input("Do you want to add more items(y/n):")
loop2=input("Do you want to continue editing stocks(y/n):")
elif ch==2:
loop="y"
while loop2=="y" or loop2=="Y":
pcode=int(input("Enter product code:"))
nprice=int(input("Enter your new price:"))
c.execute("update Stock set Price='"+str(nprice)+"' where
p_code='"+str(pcode)+"' ")
con.commit()
loop=input("Do you want to continue updating(y/n):")
loop2=input("Do you want to continue editing stocks(y/n):")
elif ch==3:
loop="y"
while loop2=="y" or loop2=="Y":
pcode=int(input("Enter product code:"))
c.execute("delete from stock where
p_code='"+str(pcode)+"' ")
con.commit()
print("Record successfully updated..")
loop=input("Do you want to delete more items(y/n):")
loop2=int("Do you want to continue editing stocks(y/n):")
elif ch==4:
loop="y"
while loop2=="y" or loop2=="Y":
c.execute("select * from Stock")
print("||p_code ||p_name ||quantity ||price ||")
for i in c:
t_code,t_name,t_quan,t_price=i
print(f"{t_code} || {t_name} ||{t_quan} ||{t_price}")
loop=input("Do you want to delete more items(y/n):")
loop2=int("Do you want to continue editing stocks(y/n):")
elif ch==5:
loop="y"
while loop2=="y" or loop2=="Y":
old_Pass=input("Enter your old password:")
c.execute("select * from Login")
for i in c:
Username,password=i
if old_Pass==password:
new_Pass=input("Enter your new password")
c.execute("update Login set password='"+new_Pass+"'
")
con.commit()
print("Your Password is changed successfully")
loop=input("Do you want to delete more items(y/n):")
loop2=int("Do you want to continue editing stocks(y/n):")
elif ch==6:
break
else:
print("Wrong password")
elif ch==2:
print("""
1. Item Bucket
2. Payment
3. View Available Items
4. Go Back
""")
ch2=int(input("Enter your choice:"))
if ch2==1:
Name=input("Enter your Name:")
p_code=int(input("Enter the product code:"))
p_quan=int(input("Enter the quantity of the product you want:"))
c.execute("select * from Stock where p_code='"+str(p_code)+"' ")
for i in c:
t_code,t_name,t_quan,t_price=i
amount=t_price*p_quan
net_quan=t_quan-p_quan
c.execute("update Stock set p_quantity='"+str(net_quan)+"' where
p_code='"+str(p_code)+"' ")
c.execute("insert into Purchase
values(now(),'"+Name+"','"+str(p_code)+"','"+str(amount)+"')")
con.commit()
elif ch2==2:
print(f"Amount to be paid: {amount}")
elif ch2==3:
print("Code||Name ||Price ||")
c.execute("select *from Stock")
for i in c:
t_code,t_name,t_quan,t_price=i
print(f"{t_code}||{t_name} ||{t_price}")
elif ch2==4:
break
elif ch==3:
break
Executed Output Screenshots:
TABLES IN MYSQL
Limitations
The limitation of the application is more
improvement in online purchasing Limited
items had been stored and need more
upgrade and maintenance of the
application.
Storage capacity is too small that’s why
we cannot store large amount of data,
therefore backup is necessary for the data
for future improvement.
Future scope
In future our system can include
accounting system, better backup, and
restore facility.
System will be so much flexible in future
that it can increase easy and new
modules which can be added easily.
You can add worker admission as well
as online ordering system.
Make online orders more effective,
efficient, and more dynamic such that it
help to get good support from the public.
Bibliography
Computer science with Sumita Arora
www.wikipedia.org
www.w3resource.com
Under the guidance of Kalyan Bharadwaj

You might also like