Project File CS
Project File CS
NOIDA EXTENSION
AY-2024-25
CLASS- 12-A
ROLL NO- 41
1
ACKNOWLEDGEMENT
I would like to express a deep sense of thanks & gratitude to
my Computer Science teacher Ms. Pinki Mahto for guiding
me immensely through the course of the project. Madam has
always evinced keen interest in my work. Her constructive
advice & constant motivation have been responsible for the
successful completion of this project.
Thank You
Vaanya Trivedi
2
CERTIFICATE
Principal
3
SUPERMARKET
BILLING
SYSTEM
4
OBJECTIVE
PROJECT SPECIFICATION:
5
1. Creating a new account (SIGN UP)
2. Login into account
3. Adding product details
4. To generate bill and amount
5. To check the purchase history of
all products
6. To get the customer feedback
7. To delete the product
6
SOFTWARE USED-
FRONT END:
BACK END:
MySQL:
MySQL is an open-source ,relational database management
system (RDBMS) developed by Oracle Corporation. MySQL is
the world's most popular open-source database. With its
proven performance, reliability and ease-of-use, MySQL has
become the leading database choice for web based
applications, used by high profile web properties including
Facebook, Twitter, YouTube, Yahoo! and many more. This
Project uses MySQL database as the first back-end application
to store Supermarket Billing Details and is connected to the
front-end application.
7
MODULES USED-
1. MySQL.Connector Module:
import mysql.connector
Function Used:
a) db = mysql.connect(host="Localhost", user="root",
password="vaanya123", auth_plugin='mysql_native_password')
b) mycursor=mydb.cursor()
c) mycursor. execute()
d) mydb.commit()
e) data=mycursor.fetchall()
f) data=mycursor.fetchone()
g) mydb.Close()
2. Tabulate Module:
The tabulate is a popular Python library used to display the data in
tabular format. It takes structured data, such as lists of lists or
dictionaries, and formats it into a visually appealing table. In the
8
Project, this module is used to display the data retrieved from MySQL
tables in Tabular from. Function Used:
9
Code-
import mysql.connector
import tabulate as tb
mydb =
mysql.connector.connect(host="localhost",user="root",password="vaan
ya123",auth_plugin="mysql_native_password")
print(mydb)
mycursor=mydb.cursor()
mydb.commit()
10
while(True):
print("1-SIGNUP: ")
print("2-existing user: Please login")
print("3-Enter product information: ")
print("4-Generating bill report: ")
print("5-Customer feedback: ")
print("6-PURCHASE HISTORY")
print("7-DELETING the product")
ch=int(input("Enter your choice:"))
if(ch==1):
print("Please enter your user details-")
uid=input("Enter the user id:")
name=input("Enter your name: ")
password=input("Enter your password: ")
phone_no=input("Enter your phone number: ")
mycursor.execute("insert into user
values('"+uid+"','"+name+"','"+password+"','"+phone_no+"')")
mycursor.execute("create table if not exists "+uid+"(pname
char(20),price decimal(8,2),qty int,Total_price decimal(8,2))")
mydb.commit()
print("User Registration done successfully.")
# User Login
if (ch == 1):
print("Please enter your user details")
uid = input("Enter the user id:")
pwd = input("Enter the password:")
11
query = "select * from user where user_id='" + uid + "' and
password='" + pwd + "'"
mycursor.execute(query)
data = mycursor.fetchall()
if data != []:
print("User logged in successfully")
else:
print("User ID or Password Incorrect")
# Add Product
elif (ch == 2):
print("Please enter product details")
sid = input("Enter serial id:")
pname = input("Enter product name:")
price = float(input("Enter price:"))
qty = int(input("Enter the quantity:"))
total_price = price * qty
# View Cart
elif (ch == 3):
uid = input("Enter the uid:")
mycursor.execute("select * from " + uid)
12
table_rows = mycursor.fetchall()
columns = ["pname", "price", "qty", "total_price"]
data = tabulate(table_rows, headers=columns,
tablefmt="simple_grid")
print(data)
print("**THANK YOU FOR SHOPPING**")
print("**BILL SUCCESSFULLY GENERATED**")
# Feedback
elif (ch == 4):
print("Customer feedback*************")
ch1 = int(input("Enter feedback about store and services OUT OF
10:"))
print(ch1)
print("THANK YOU FOR YOUR FEEDBACK")
# Generate Bill
elif (ch == 5):
mycursor.execute("select pname, price, qty from storeproducts")
table_rows = mycursor.fetchall()
data = tabulate(table_rows, headers=["pname", "price", "qty",
"total_price"], tablefmt="double_outline")
print(data)
print("**BILL SUCCESSFULLY GENERATED**")
if (ch == 7):
print("********Please enter your user details*******")
13
pwd = input("Enter the password:")
if data != []:
print("User logged in successfully")
query = "select pname from " + uid
mycursor.execute(query)
data = mycursor.fetchall()
market = []
for i in data:
for j in i:
market.append( j)
if item in market:
query = "delete from " + uid + " where pname='" + product + "'"
mycursor.execute(query)
mydb.commit()
14
else:
print("No Products found")
else:
print("User ID INCORRECT")
else:
print("**THANK YOU FOR SHOPPING***")
print("**BILL SUCCESSFULLY GENERATED***")
15
TABLES-
Database used-
Table used-
16
Table-a1
Table-a2
17
Table-a3
Table-a4
18
Table-a5
Table-a6
19
Table storeproducts-
Table user-
20
21
22
23
24
BIBLIOGRAPHY-
2) https://www.w3schools.com
3) https://www.mysql.com
4) https://pypi.org
APPLICATION-
25
26