Retail Mgmt System
Retail Mgmt System
Academic Session:2024-25
Project Report
on
“Retail Management System”
(For AISSCE 2024-25 Examination)
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.
6. Coding 16
7. Output Screens 37
8. User Manual 44
9. Bibliography 46
5
INTRODUCTION
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.
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.
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
V. Printer : LaserJet
SOFTWARE REQUIREMENTS:
9
Modules and Functions Used
10
Following modules are used in this project:
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.
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()
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()
mycon.close()
19
def update_product():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
mycon.close()
def view_returns():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
21
mycon.close()
def view_reviews():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
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: ")
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()
25
mycon.close()
def add_to_cart():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
mycon.close()
def view_cart():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
mycon.close()
27
def checkout():
mycon = mc.connect(host='localhost', user='root', passwd='ishant123',
database='project')
mycur = mycon.cursor()
address=input("Enter your address: ")
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))
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: ")
29
mycur.execute("SELECT AVG(rating) FROM product_reviews WHERE
item_no = %s", (item_no,))
average_rating = mycur.fetchone()[0]
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()
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.
4. Delete Product: Allows the admin to delete a product from the system
based on its item number.
44
8. Exit: Exits the admin module.
• If you choose "Customer Login," you will have access to the following
options:
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.
7. Return Product: Initiates the return process for a product by providing the
item number, customer name, and reason for the return.
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