0% found this document useful (0 votes)
13 views

Retail Mgmt System

Uploaded by

Nishant Raghav
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)
13 views

Retail Mgmt System

Uploaded by

Nishant Raghav
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/ 45

Vandana International School

Academic Session:2024-25

Project Report
on
“Retail Management System”
(For AISSCE 2024-25 Examination)

Submitted by- Project Guide -


Roll No: Ms. Madhu Sehgal
Name: PGT(Computer Science)
Class: XII
Subject: Computer Science
Subject Code: 083
Certificate
This is to certify that ___________of Class XII, Vandana
International School, has successfully developed his/her
Computer Science Project titled “Retail Management
System”, under my supervision. The work done by
him/her is original and is submitted for the AISSCE
(Session 2024-25) as prescribed by CBSE.

Signature of Signature of
Internal Examiner External Examiner
ACKNOWLEDGEMENT

Apart from the efforts of me, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in the successful completion of this
project. I express deep sense of gratitude to almighty God for giving me strength for
the successful completion of the project. I am greatly indebted to Ms Madhu Sehgal,
Teacher in Computer Science who gave me immense support and guidance
throughout the completion of this project.

I express my heartfelt gratitude to my parents for constant encouragement while


carrying out this project. I gratefully acknowledge the contribution of the individuals
who contributed in bringing this project up to this level, who continues to look after me
despite my flaws, The guidance and support received from all the members who
contributed and who are contributing to this project, was vital for the success of the
project. I am grateful for their constant support and help.
Index
S. No. Title Page Nos.

1. Introduction to the Project 6

2. Objective & Scope of the Project 7

3. Hardware and Software Requirements 9

4. Modules and Functions used 10

5. Database and Tables used 14

6. Coding 16

7. Output Screens 37

8. User Manual 44

9. Bibliography 46

5
INTRODUCTION

The Retail Management System is a comprehensive software solution


designed to streamline and automate the operations of a retail business.
This program offers an automated solution for managing a shopping
system, catering to both customers and administrators.

For customers, the Retail Management System provides a user-friendly


interface that allows them to view and purchase products, add items to
their cart, submit reviews, and perform various related operations.
Customers can conveniently browse through the product catalog, view
detailed information about each item, and make informed purchase
decisions. The system enables quick and hassle-free checkout, ensuring a
smooth shopping experience.

On the other hand, the program includes an admin module that empowers
administrators to efficiently manage the shopping system. Administrators
can add new products to the system, update existing product information,
and delete products as needed. The system also generates comprehensive
sales reports, providing valuable insights into product performance and
overall business success. Additionally, administrators can view and
manage product reviews, helping them monitor customer feedback and
make necessary improvements.

Overall, the Retail Management System developed by Ishant Sharma


offers a robust solution for retail businesses. It simplifies operations,
enhances productivity, and provides a seamless shopping experience for
customers.
6
OBJECTIVES AND SCOPE OF
THE PROJECT
The main objective of Retail Management System is to automate and streamline
the management of a shopping system. The program offers various features and
functionalities for both customers and administrators, making the shopping
experience efficient and convenient.

The purpose of the project is to build an application program to reduce the


manual work for managing the information.

Through the proposed system users can do the following tasks - add products,
display products, add to cart, view cart, edit information, checkout, Submit
reviews etc. in quick time. Our proposed system has the following advantages.

. User friendly interface


. Fast access to database
. Reduced error
. More Storage Capacity
. Search facility
. Look and Feel Environment
. More efficien

7
In the future, the retail management system program can be enhanced by
incorporating additional features such as online payment integration, order tracking,
and personalized customer accounts. This would enable customers to make secure
online payments, track the status of their orders, and access their purchase history,
simplifying the shopping experience and increasing customer satisfaction.
Furthermore, integrating inventory management functionality can automate stock
updates, generate alerts for low inventory levels, and streamline the replenishment
process. These advancements would optimize the overall efficiency of the system,
reduce manual efforts, and provide a more convenient and tailored shopping
experience for customers.

8
Hardware and Software
Specifications
HARDWARE REQUIREMENTS

I. PROCESSOR : Intel CORE i5

II. RAM : 8GB

III. Hard disk : 1 TB

IV. CD/DVD r/w multi drive combo: Pen-drive

V. Printer : LaserJet

SOFTWARE REQUIREMENTS:

I. OPERATING SYSTEM : WINDOWS 10

II. PROGRAMMING LANGUAGE : Python 3.10.2


III. RDBMS : MySQL Server and Client

9
Modules and Functions Used

Front end: The front end was designed using Python.


Python is an interpreted, object-oriented, high-level programming language
with dynamic semantics. Its high-level built in data structures, combined with
dynamic typing and dynamic binding, make it very attractive for Rapid
Application Development, as well as for use as a scripting or glue language to
connect existing components together. Python's simple, easy to learn syntax
emphasizes readability and therefore reduces the cost of program maintenance.
Python supports modules and packages, which encourages program modularity
and code reuse. The Python interpreter and the extensive standard library are
available in source or binary form without charge for all major platforms, and
can be freely distributed.

Back end: The backend was designed using MySQL.


MySQL is a relational database management system (RDBMS) developed by
Oracle that is based on structured query language (SQL).MySQL is integral to
many of the most popular software stacks for building and maintaining
everything from customer-facing web applications to powerful, data-driven
B2B services. Its open-source nature, stability, and rich feature set.

10
Following modules are used in this project:

• mysql.connector : MySQL Connector/Python enables Python programs to


access MySQL databases, using an API that is compliant with the Python
Database API Specification v2.0 (PEP 249). It is written in pure Python
and does not have any dependencies except for the Python Standard
Library.
• tabulate : The tabulate module in Python allows easy formatting and
presentation of tabular data. It simplifies the process of creating visually
appealing tables from different data structures, such as lists or
dictionaries. With tabulate, you can choose from various table formats
and customize headers, alignment, and column formatting. It offers a
convenient way to display tabular data in a well-organized and readable
format without manual manipulation.

Following functions have been used in this project :


1) create_product_table():
This function creates all the necessary tables in the database for product
management.
2) add_product():
This function allows the admin to add a new product to the database. It
prompts for the product name and price, inserts the data into the "products"
table, and updates the "sales" table with the initial sales value zero.
3) delete_product():
This function allows the admin to delete a product from the database based
on its item number.

11
4) update_product():
This function allows the admin to update the details of an existing
product in the database. It has the options of changing the name and
price of the product.
5) view_returns():
This function retrieves and displays the details of product returns stored in
the "returns" table
6) view_reviews():
This function prompts for an item number and retrieves and displays the
reviews of that product stored in the "product_reviews" table.
7) sales_report():
This function retrieves and displays a sales report from the "sales" table. It
includes the item numbers, names, prices, total sales, and total earnings for
each product.
8) display_products ():
This function retrieves and displays all the products available, including their
item numbers, names, prices, and ratings.
9) search_products():
This function allows customers to search for products by entering a product
name. It retrieves and displays the matching products.
10) view_popular_products ():
This function retrieves and displays the most popular products based on
their total sales.

12
11) add_to_cart ():
This function allows customers to add products to their cart. It asks for the
item number and quantity, checks if the product exists, and inserts the item
number and quantity into the "cart" table.
12) view_cart ():
This function retrieves and displays the products in the customer's cart from
the "cart" table. It includes the product names, prices, quantities, and total
prices.
13) checkout ():
This function finalizes the purchase by updating the "sales" table with the
total sales for each product and clears the "cart" table. It also prompts the
customer to enter their address. Currently it doesn’t have payment options
(only COD). In future, more payment options can be added.
14) submit_review ():
This function allows customers to submit reviews for a specific product. It
asks for the item number, rating, and reviewer's name. It inserts the review
into the "product_reviews" table and calculates the average rating for each
product.
15) return_product ():
This function allows customers to initiate a return for a product. It asks for
the customer's name, item number, and reason for the return. It inserts the
return details into the "returns" table.

16) help_support ():


This function provides contact information for customer support.

13
Database and Tables Used
Database used in this project :

• project
Tables used in this project :

• products

• sales

• cart

14
• product_reviews

• returns

15
SOURCE CODE
# project name : Retail management system
# made by : Ishant Sharma

'''
Retail Management System
By: Ishant Sharma
School: New Era Public School, Dwarka
Class: 12
'''
from tabulate import tabulate
import mysql.connector as mc

def create_product_table():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
mycur.execute("CREATE TABLE IF NOT EXISTS products (item_no INT
AUTO_INCREMENT PRIMARY KEY, name VARCHAR(40), price
DECIMAL(10, 2), Reviews DECIMAL(2,1))")

16
mycur.execute("CREATE TABLE IF NOT EXISTS cart (id INT
AUTO_INCREMENT PRIMARY KEY, item_no INT, quantity INT, FOREIGN
KEY (item_no) REFERENCES products(item_no))")
mycur.execute("CREATE TABLE IF NOT EXISTS sales (item_no INT
AUTO_INCREMENT PRIMARY KEY, name VARCHAR(40), price
DECIMAL(10,2), Total_sales BIGINT(10))")
mycur.execute("CREATE TABLE IF NOT EXISTS product_reviews
(review_id INT AUTO_INCREMENT PRIMARY KEY, item_no INT,
reviewer_name VARCHAR(20), rating DECIMAL(2,1), FOREIGN KEY
(item_no) REFERENCES products(item_no))")
mycur.execute("CREATE TABLE IF NOT EXISTS returns (return_id INT
AUTO_INCREMENT PRIMARY KEY, item_no INT, customer_name
VARCHAR(20), reason VARCHAR(100), FOREIGN KEY (item_no)
REFERENCES products(item_no))")

mycon.close()

17
def add_product():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()

name = input("Enter the product name: ")


price = float(input("Enter the product price: "))

st = "INSERT INTO products (name, price) VALUES (%s, %s)"


mycur.execute(st, (name,price))

st = "INSERT INTO sales (name, price,total_sales) VALUES (%s,


%s,%s)"
mycur.execute(st, (name,price,0))

mycon.commit()
print("Product added successfully!")
mycon.close()

18
def delete_product():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()

item_no = int(input("Enter the item number of the product to delete: "))

mycur.execute("SELECT * FROM products WHERE item_no = %s",


(item_no,))
product = mycur.fetchone()

if product is not None:


mycur.execute("DELETE FROM products WHERE item_no = %s",
(item_no,))
mycon.commit()
print("Product deleted successfully!")
else:
print("Product not found!")

mycon.close()

19
def update_product():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()

item_no = int(input("Enter the item number of the product to update: "))

mycur.execute("SELECT * FROM products WHERE item_no = %s",


(item_no,))
product = mycur.fetchone()

if product is not None:


name = input("Enter the updated product name: ")
price = float(input("Enter the updated product price: "))

mycur.execute("UPDATE products SET name = %s, price = %s


WHERE item_no = %s", (name, price, item_no))
mycur.execute("UPDATE sales SET name = %s, price = %s WHERE
item_no = %s", (name, price, item_no))
mycon.commit()
20
print("Product updated successfully!")
else:
print("Product not found!")

mycon.close()

def view_returns():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()

mycur.execute("SELECT return_id, item_no, customer_name, reason


FROM returns")
returns = mycur.fetchall()

if returns is not None:


headers = ['Return ID', 'Item No.', 'Customer Name', 'Reason']
print(tabulate(returns, headers=headers, tablefmt='pretty'))
else:
print("No return details found.")

21
mycon.close()

def view_reviews():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()

item_no = int(input("Enter the item number of the product to view reviews:


"))

mycur.execute("SELECT reviewer_name, rating FROM product_reviews


WHERE item_no = %s", (item_no,))
reviews = mycur.fetchall()

if reviews is not None:


headers = ['Reviewer Name', 'Rating']
print(tabulate(reviews, headers=headers, tablefmt='pretty'))
else:
print("No reviews found for the product.")
22
mycon.close()

def display_products():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
mycur.execute("SELECT item_no, name, price, reviews FROM products")
data = mycur.fetchall()
headers = ['Item No.', 'Name', 'Price', 'Ratings']
print(tabulate(data, headers=headers, tablefmt='pretty'))

mycon.close()

def search_products():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()

23
product_name = input("Enter the product name to search: ")

mycur.execute("SELECT item_no, name, price, reviews FROM products


WHERE name LIKE '%" + product_name + "%'")
data = mycur.fetchall()

if data is not None:


headers = ['Item No.', 'Name', 'Price', 'Ratings']
print(tabulate(data, headers=headers, tablefmt='pretty'))
else:
print("No products found with the given name.")

mycon.close()

def sales_report():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
mycur.execute("SELECT item_no, name, price, total_sales, price *
total_sales AS Total_earnings FROM sales")
24
data = mycur.fetchall()
headers = ['Item No.', 'Name', 'Price', 'Total Sales', 'Total Earnings']
print(tabulate(data, headers=headers, tablefmt='pretty'))

mycon.close()

def view_popular_products():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()

mycur.execute("SELECT item_no, name, price, total_sales FROM sales


ORDER BY total_sales DESC")
popular_products = mycur.fetchall()

if popular_products is not None:


headers = ['Item No.', 'Name', 'Price', 'Total Sales']
print(tabulate(popular_products, headers=headers, tablefmt='pretty'))
else:
print("No popular products found.")

25
mycon.close()

def add_to_cart():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()

item_no = int(input("Enter the item number: "))


quantity = int(input("Enter the quantity: "))

mycur.execute("SELECT * FROM products WHERE item_no = %s",


(item_no,))
product = mycur.fetchone()

if product is not None:


st = "INSERT INTO cart (item_no, quantity) VALUES (%s, %s)"
mycur.execute(st, (item_no, quantity))
mycon.commit()
26
print("Product added to cart successfully!")
else:
print("Product not found!")

mycon.close()

def view_cart():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()

mycur.execute("SELECT products.name, products.price, cart.quantity,


cart.quantity * products.price AS total_price FROM cart,products where
cart.item_no = products.item_no;")
data = mycur.fetchall()
headers = ['Name', 'Price', 'Quantity', 'Total Price']
print(tabulate(data, headers=headers, tablefmt='pretty'))

mycon.close()

27
def checkout():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
address=input("Enter your address: ")

mycur.execute("SELECT item_no, quantity FROM cart")


cart1 = mycur.fetchall()

for i in cart1:
item_no = i[0]
quantity = i[1]
mycur.execute("UPDATE sales SET total_sales = total_sales + %s
WHERE item_no = %s", (quantity, item_no))

mycur.execute("DROP TABLE IF EXISTS cart")


mycur.execute("CREATE TABLE IF NOT EXISTS cart (id INT
AUTO_INCREMENT PRIMARY KEY, item_no INT, quantity INT, FOREIGN
KEY (item_no) REFERENCES products(item_no))")
mycon.commit()
28
print("Checkout successful!")

mycon.close()

def submit_review():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()

display_products()
item_no = int(input("Enter the item number to review: "))
rating = float(input("Enter your rating (out of 10): "))
reviewer_name = input("Enter your name: ")

st = "INSERT INTO product_reviews (item_no, reviewer_name, rating)


VALUES (%s, %s, %s)"
mycur.execute(st, (item_no, reviewer_name, rating))
mycon.commit()

29
mycur.execute("SELECT AVG(rating) FROM product_reviews WHERE
item_no = %s", (item_no,))
average_rating = mycur.fetchone()[0]

mycur.execute("UPDATE products SET reviews = %s WHERE item_no =


%s", (average_rating, item_no))
mycon.commit()

print("Review submitted successfully!")

mycon.close()

def return_product():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
name=input("Enter your name: ")
item_no = int(input("Enter the item number of the product to return: "))
reason = input("Enter the reason for the return: ")

30
mycur.execute("SELECT * FROM products WHERE item_no = %s",
(item_no,))
product = mycur.fetchone()

if product is not None:


st = "INSERT INTO returns (item_no, customer_name, reason)
VALUES (%s, %s, %s)"
mycur.execute(st, (item_no, name, reason))
mycon.commit()
print("Product return initiated successfully!")
else:
print("Product not found!")

mycon.close()

def help_support():
print("For any assistance, please contact our customer service.")
print("Phone: 123-456-7890")
print("Email: [email protected]")
31
#MAIN PROGRAM
create_product_table()
while True:
print(“MAIN MENU")
print("1. Admin Login")
print("2. Customer Login")
print("3. Exit")
choice = int(input("Choose login type: "))

if choice == 1:
adminid="admin"
passwd = 'admin123'
i = input("Enter the admin id: ")
p = input("Enter the password: ")
if p == passwd and i == adminid:
print("ADMIN LOGIN SUCCESSFUL")

while True:
32
print("1. Add New Product")
print("2. Sales Report")
print("3. Update Product")
print("4. Delete Product")
print("5. View Product Reviews")
print("6. View Popular Products")
print("7. View Returns")
print("8. Exit")
choice = int(input("Choose your input: "))

if choice == 1:
add_product()
elif choice == 2:
sales_report()
elif choice == 3:
update_product()
elif choice == 4:
delete_product()
elif choice == 5:
view_reviews()
33
elif choice == 6:
view_popular_products()
elif choice == 7:
view_returns()
elif choice == 8:
print("Exited from program.")
break
else:
print("Invalid input")
else:
print("Invalid admin id or password")

elif choice == 2:
while True:
print("1. Display Products")
print("2. Search Products")
print("3. Add to Cart")
print("4. View Cart")
print("5. Submit Review")
print("6. Checkout")
34
print("7. Return Product")
print("8. Help And Support")
print("9. Exit")
choice = int(input("Choose your input: "))

if choice == 1:
display_products()
elif choice == 2:
search_products()
elif choice == 3:
add_to_cart()
elif choice == 4:
view_cart()
elif choice == 5:
submit_review()
elif choice == 6:
checkout()
elif choice == 7:
return_product()
elif choice == 8:
help_support()
35
elif choice == 9:
print("Exited from program.")
break
else:
print("Invalid input")

elif choice == 3:
print("Exited from program.")
break
else:
print("Invalid selection")

36
Output Screens

37
38
39
40
41
42
43
User Manual
• Upon running the program, the main menu will be displayed with the
following options:
1. Admin Login
2. Customer Login
3. Exit

• If you choose "Admin Login," you will be prompted to enter the admin ID and
password. Upon successful login, the admin will have access to the following
options:

1. Add New Product: Allows the admin to add a new product to the system,
including its name, price, and other details.

2. Sales Report: Generates a report of product sales, including details such as


item number, name, price, total sales, and total earnings.

3. Update Product: Enables the admin to update the information of an


existing product, such as its name and price.

4. Delete Product: Allows the admin to delete a product from the system
based on its item number.

5. View Product Reviews: Displays the reviews and ratings submitted by


customers for a particular product.

6. View Popular Products: Shows a list of popular products based on their


total sales.

7. View Returns: Displays a list of products that have been returned by


customers along with the reasons for the return.

44
8. Exit: Exits the admin module.

• If you choose "Customer Login," you will have access to the following
options:

1. Display Products: Displays a list of available products, including their item


number, name, price, and ratings.

2. Search Products: Allows you to search for specific products based on their
name.

3. Add to Cart: Enables you to add a product to your cart by specifying the
item number and quantity.

4. View Cart: Displays the items currently present in your cart along with
their prices and quantities.

5. Submit Review: Allows you to submit a review for a particular product,


including your rating and name.

6. Checkout: Finalizes your purchase by generating a sales report and clearing


the cart. You will be prompted to enter your address.

7. Return Product: Initiates the return process for a product by providing the
item number, customer name, and reason for the return.

8. Help And Support: Provides contact information for customer support.

9. Exit: Exits the customer module.

• If you choose "Exit", you will be exited from the program

45
Bibliography

Websites:
1) https://www.w3schools.com
2) https://www.python.org
3) https://www.mysqltutorial.org

Books:
1) Computer science with python by Sumita Arora
2) Computer science with python by Preeti Arora

46

You might also like