COMP SC PROJECT FINAL
COMP SC PROJECT FINAL
1
Retail Management System
Investigatory Project Submitted to CBSE in Partial
fulfillment of the requirements for completing
Higher Secondary
By
K.Harish Srinivas
2
CERTIFICATE OF COMPLETION
Principal: Teacher:
Mrs.Mala Daniel Mr.Joel Lazarus
Place:
Date:
3
ACKNOWLEDGMENT
I extend all glory, honor, and thanks to the most loving and
merciful God Almighty for His boundless grace which
enabled me to succeed in this endeavor.
4
THE VIKASA SCHOOL SAWYERPURAM
COMPUTER SCIENCE PROJECT
Register number:
Certified Bonafide Record of project work done by
…………………… during the year …………………………
5
Table of Contents
1. Introduction ..........................................................
2. Objectives ..........................................................
3. System Requirements .........................................
4. Project Description .............................................
5. Modules Description .........................................
6. Database Design ................................................
7. Source Code .......................................................
8. Screenshots of the Application .........................
9. Bibliography .......................................................
6
Introduction
The Retail Management System project is a
comprehensive solution designed to streamline the
various operations of a retail business. In today's fast-
paced world, managing retail efficiently is crucial to
ensuring customer satisfaction, optimizing resources,
and maximizing profitability. This project combines the
power of Python programming with MySQL database
management to deliver a robust and user-friendly
application.
The system facilitates the organization and management
of essential data such as supplier information, product
catalogs, customer records, inventory levels, and sales
transactions. By automating routine tasks and providing
real-time insights, the Retail Management System
minimizes human error and improves decision-making
processes.
This project has been developed keeping in mind the
needs of modern retail environments, ensuring
scalability, reliability, and ease of use. It is an excellent
example of how technology can transform traditional
business operations into efficient and data-driven
processes.
7
Objectives
1. Efficient Inventory Management
o Track and manage product stock levels to prevent
overstocking or shortages.
2. Streamlined Sales Process
o Facilitate quick and accurate sales transactions with
detailed records of each sale.
3. Comprehensive Customer Records
o Maintain a database of customers to enhance
customer service and support marketing activities.
4. Supplier Relationship Management
o Manage supplier information to ensure timely
procurement and maintain good supplier
relationships.
5. Data-Driven Decision Making
o Provide detailed reports and analytics for better
business insights and strategic planning.
6. User-Friendly Interface
o Offer an intuitive and easy-to-navigate system for
efficient operation.
7. Secure Data Handling
o Ensure the safety and integrity of business data
through robust security measures.
8
System Requirements for Retail
Management System
Hardware Requirements
1. Processor: Minimum 2.0 GHz dual-core processor.
2. RAM: At least 4 GB (8 GB recommended for better
performance).
3. Storage: 20 GB free disk space.
4. Display: Minimum 1366 x 768 resolution.
5. Input Devices: Keyboard and mouse.
6. Network: Internet connection for cloud-based features and
updates.
Software Requirements
1. Operating System: Windows 10/11, macOS 10.14 or later, or a
Linux distribution.
2. Database: MySQL 8.0 or higher.
3. Programming Environment: Python 3.10 or higher.
4. Required Libraries:
o mysql-connector-python
o pandas (optional for reporting features).
5. IDE/Text Editor: PyCharm, VS Code, or IDLE.
6. Web Browser: Google Chrome, Mozilla Firefox, or any modern
browser for web-based access.
Additional Requirements
1. Backup Storage: External storage for regular data backups.
2. Security Tools: Antivirus software and firewall for data
protection.
9
Project Description
Key Features:
1. Inventory Management:
o Product Catalog: Maintain a list of products, including
details such as name, description, price, and stock quantity.
o Stock Updates: Automatically update stock levels upon each
sale and allow for manual adjustments when needed.
o Reordering Alerts: Set thresholds for stock levels to trigger
alerts when products need to be reordered.
2. Sales Transactions:
o Point of Sale (POS): Simplify the sales process with a quick
and easy-to-use interface for processing transactions.
o Discounts and Offers: Apply discounts, promotions, or
special pricing for customers during sales.
o Invoice Generation: Generate and print invoices for
customers with details about the transaction, including items
purchased, quantity, total price, and taxes.
3. Customer Management:
o Customer Profiles: Store and manage customer information,
such as contact details, purchase history, and preferences.
o Loyalty Programs: Track loyalty points for returning
customers and offer rewards or discounts for frequent buyers.
o Communication: Send promotional emails or messages to
customers based on their purchase history or preferences.
4. Reporting and Analytics:
o Sales Reports: Generate daily, weekly, and monthly sales
reports with details on top-selling products, total sales, and
customer demographics.
10
o Inventory Reports: Track product performance, stock levels,
and inventory turnover.
o Financial Summaries: Produce profit and loss statements, tax
summaries, and other financial reports.
5. User Management and Security:
o Role-based Access: Implement role-based permissions
(admin, manager, cashier) to restrict access to sensitive data
and actions.
o Authentication: Secure login system with username and
password to protect against unauthorized access.
o Audit Logs: Maintain a history of system actions, including
sales, inventory changes, and user activities, to ensure
transparency.
6. Multi-Store Support (Optional):
o Centralized Management: Manage multiple stores from a
single platform with support for separate inventory and sales
data for each location.
o Consolidated Reports: Generate reports that combine data
from all stores for overall business analysis.
7. Cloud and Offline Functionality (Optional):
o Cloud Deployment: Host the system on the cloud for easy
access from any location, with real-time data synchronization.
o Offline Mode: Support offline functionality in case of internet
disruptions, allowing sales to continue and sync data once the
connection is restored.
11
Modules Description
1. Supplier Management Module
• Purpose: Manage supplier information, including contact
details and address.
• Key Features:
o Add, update, and delete supplier records.
o Track supplier relationships for procurement purposes.
2. Product Management Module
• Purpose: Handle product details and categories.
• Key Features:
o Store product information such as name, category, price,
and description.
o Link products to their respective suppliers.
3. Inventory Management Module
• Purpose: Monitor stock levels and manage inventory.
• Key Features:
o Track quantity in stock and reorder levels.
o Generate alerts for low stock levels.
4. Customer Management Module
• Purpose: Maintain customer data for personalized service.
• Key Features:
o Store customer contact details and address.
o View and manage customer purchase history.
12
5. Sales Management Module
• Purpose: Record and manage sales transactions.
• Key Features:
o Process sales with details like date, quantity, and payment
method.
o Generate sales receipts and reports.
6. Reporting and Analytics Module
• Purpose: Provide insights for data-driven decisions.
• Key Features:
o Generate reports on sales, inventory, and customer trends.
o Visualize data using charts and graphs.
7. User Management and Security Module
• Purpose: Ensure secure access and data integrity.
• Key Features:
o Create and manage user accounts.
o Implement role-based access control to restrict
permissions.
13
Database Design
1. Suppliers Table
• Purpose: Store supplier details for procurement.
• Fields:
o SupplierID (Primary Key): Unique identifier for each
supplier.
o SupplierName: Name of the supplier.
o ContactName: Name of the contact person.
o Address: Supplier's address.
o City: Supplier's city.
o State: Supplier's state.
o Phone: Contact number of the supplier.
o Email: Email address of the supplier.
2. Products Table
• Purpose: Manage product information.
• Fields:
o ProductID (Primary Key): Unique identifier for each
product.
o ProductName: Name of the product.
o Category: Category to which the product belongs.
o Price: Price of the product.
o Description: Description of the product.
o SupplierID (Foreign Key): Links to the Suppliers table.
14
3. Customers Table
• Purpose: Store customer information.
• Fields:
o CustomerID (Primary Key): Unique identifier for each
customer.
o FirstName: Customer's first name.
o LastName: Customer's last name.
o Email: Customer's email address.
o Phone: Customer's contact number.
o Address: Customer's address.
o City: Customer's city.
o State: Customer's state.
o ZipCode: Customer's zip code.
4. Inventory Table
• Purpose: Monitor product stock levels.
• Fields:
o ProductID (Primary Key, Foreign Key): Links to the
Products table.
o QuantityInStock: Current stock quantity.
o ReorderLevel: Minimum stock level before reordering.
o ReorderQuantity: Quantity to reorder.
15
5. Sales Table
• Purpose: Record sales transactions.
• Fields:
o SaleID (Primary Key): Unique identifier for each sale.
o ProductID (Foreign Key): Links to the Products table.
o CustomerID (Foreign Key): Links to the Customers table.
o SaleDate: Date of the sale.
o QuantitySold: Quantity of products sold.
o SaleAmount: Total amount of the sale.
o PaymentMethod: Method of payment used.
Relationships:
1. Suppliers to Products:
o One-to-Many: A supplier can supply multiple products.
2. Products to Inventory:
o One-to-One: Each product has a unique inventory record.
3. Products to Sales:
o One-to-Many: A product can appear in multiple sales
transactions.
4. Customers to Sales:
o One-to-Many: A customer can make multiple purchases.
16
Source Code
import mysql.connector
from mysql.connector import errorcode
# Database configuration
config = {
'user': 'root',
'password': 'harish8955',
'host': '127.0.0.1',
'database': 'RetailManagement',
'raise_on_warnings': True
}
17
# Create tables
tables = {}
tables['Suppliers'] = (
"CREATE TABLE IF NOT EXISTS Suppliers ("
" SupplierID VARCHAR(50) PRIMARY KEY,"
" SupplierName VARCHAR(100) NOT NULL,"
" ContactName VARCHAR(100),"
" Address VARCHAR(255),"
" City VARCHAR(100),"
" State VARCHAR(100),"
" Phone VARCHAR(15),"
" Email VARCHAR(100)"
") ENGINE=InnoDB"
)
tables['Products'] = (
"CREATE TABLE IF NOT EXISTS Products ("
" ProductID VARCHAR(50) PRIMARY KEY,"
" ProductName VARCHAR(100) NOT NULL,"
" Category VARCHAR(100),"
" Price DECIMAL(10, 2) NOT NULL,"
" Description TEXT,"
" SupplierID VARCHAR(50),"
" FOREIGN KEY (SupplierID) REFERENCES Suppliers(SupplierID)"
") ENGINE=InnoDB"
18
)
tables['Customers'] = (
"CREATE TABLE IF NOT EXISTS Customers ("
" CustomerID VARCHAR(50) PRIMARY KEY,"
" FirstName VARCHAR(50) NOT NULL,"
" LastName VARCHAR(50) NOT NULL,"
" Email VARCHAR(100),"
" Phone VARCHAR(15),"
" Address VARCHAR(255),"
" City VARCHAR(100),"
" State VARCHAR(100),"
" ZipCode VARCHAR(10)"
") ENGINE=InnoDB"
)
tables['Inventory'] = (
"CREATE TABLE IF NOT EXISTS Inventory ("
" ProductID VARCHAR(50) PRIMARY KEY,"
" QuantityInStock INT NOT NULL,"
" ReorderLevel INT,"
" ReorderQuantity INT,"
" FOREIGN KEY (ProductID) REFERENCES Products(ProductID)"
") ENGINE=InnoDB"
)
tables['Sales'] = (
19
"CREATE TABLE IF NOT EXISTS Sales ("
" SaleID VARCHAR(50) PRIMARY KEY,"
" ProductID VARCHAR(50),"
" CustomerID VARCHAR(50),"
" SaleDate DATE NOT NULL,"
" QuantitySold INT NOT NULL,"
" SaleAmount DECIMAL(10, 2) NOT NULL,"
" PaymentMethod VARCHAR(50),"
" FOREIGN KEY (ProductID) REFERENCES Products(ProductID),"
" FOREIGN KEY (CustomerID) REFERENCES
Customers(CustomerID)"
") ENGINE=InnoDB"
)
cursor.close()
cnx.close()
print("Database setup completed successfully")
20
except mysql.connector.Error as err:
print(err)
if table == "Suppliers":
query = ("INSERT INTO Suppliers (SupplierID, SupplierName,
ContactName, Address, City, State, Phone, Email) "
"VALUES (%s, %s, %s, %s, %s, %s, %s, %s)")
elif table == "Products":
query = ("INSERT INTO Products (ProductID, ProductName, Category,
Price, Description, SupplierID) "
"VALUES (%s, %s, %s, %s, %s, %s)")
elif table == "Customers":
query = ("INSERT INTO Customers (CustomerID, FirstName,
LastName, Email, Phone, Address, City, State, ZipCode) "
"VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)")
elif table == "Inventory":
query = ("INSERT INTO Inventory (ProductID, QuantityInStock,
ReorderLevel, ReorderQuantity) "
"VALUES (%s, %s, %s, %s)")
elif table == "Sales":
query = ("INSERT INTO Sales (SaleID, ProductID, CustomerID,
SaleDate, QuantitySold, SaleAmount, PaymentMethod) "
"VALUES (%s, %s, %s, %s, %s, %s, %s)")
21
cursor.execute(query, data)
cnx.commit()
cursor.close()
cnx.close()
print("Data inserted successfully")
22
def view_data(table):
try:
cnx = mysql.connector.connect(**config)
cursor = cnx.cursor()
cursor.close()
cnx.close()
# Main menu
def main_menu():
create_database_and_tables()
while True:
print("\nRetail Management System")
print("1. View Suppliers")
print("2. View Products")
print("3. View Customers")
23
print("4. View Inventory")
print("5. View Sales")
print("6. Insert Supplier")
print("7. Insert Product")
print("8. Insert Customer")
print("9. Insert Inventory")
print("10. Insert Sale")
print("11. Delete Supplier")
print("12. Delete Product")
print("13. Delete Customer")
print("14. Delete Inventory")
print("15. Delete Sale")
print("16. Exit")
choice = input("Enter your choice: ")
if choice == '1':
view_data("Suppliers")
elif choice == '2':
view_data("Products")
elif choice == '3':
view_data("Customers")
elif choice == '4':
view_data("Inventory")
elif choice == '5':
view_data("Sales")
elif choice == '6':
data = (
24
input("SupplierID: "),
input("SupplierName: "),
input("ContactName: "),
input("Address: "),
input("City: "),
input("State: "),
input("Phone: "),
input("Email: ")
)
insert_data("Suppliers", data)
elif choice == '7':
data = (
input("ProductID: "),
input("ProductName: "),
input("Category: "),
input("Price: "),
input("Description: "),
input("SupplierID: ")
)
insert_data("Products", data)
elif choice == '8':
data = (
input("CustomerID: "),
input("FirstName: "),
input("LastName: "),
input("Email: "),
input("Phone: "),
25
input("Address: "),
input("City: "),
input("State: "),
input("ZipCode: ")
)
insert_data("Customers", data)
elif choice == '9':
data = (
input("ProductID: "),
input("QuantityInStock: "),
input("ReorderLevel: "),
input("ReorderQuantity: ")
)
insert_data("Inventory", data)
elif choice == '10':
data = (
input("SaleID: "),
input("ProductID: "),
input("CustomerID: "),
input("SaleDate (YYYY-MM-DD): "),
input("QuantitySold: "),
input("SaleAmount: "),
input("PaymentMethod: ")
)
insert_data("Sales", data)
elif choice == '11':
primary_key_value = input("Enter SupplierID to delete: ")
26
delete_data("Suppliers", "SupplierID", primary_key_value)
elif choice == '12':
primary_key_value = input("Enter ProductID to delete: ")
delete_data("Products", "ProductID", primary_key_value)
elif choice == '13':
primary_key_value = input("Enter CustomerID to delete: ")
delete_data("Customers", "CustomerID", primary_key_value)
elif choice == '14':
primary_key_value = input("Enter ProductID to delete from Inventory:
")
delete_data("Inventory", "ProductID", primary_key_value)
elif choice == '15':
primary_key_value = input("Enter SaleID to delete: ")
delete_data("Sales", "SaleID", primary_key_value)
elif choice == '16':
print("Exiting...")
break
else:
print("Invalid choice. Please try again.")
27
Screenshots of the application
28
Inserting and Viewing Records:
29
Deleting Records:
30
Bibliography
Books:
1. Berman, B., & Evans, J. R. (2013). Retail management: A strategic
approach (12th ed.). Pearson Education.
2. Levy, M., & Weitz, B. A. (2017). Retailing management (10th ed.).
McGraw-Hill Education.
Articles:
3. Melnyk, S. A., & McHugh, P. R. (2019). Retail strategy: Current trends
and future directions. Journal of Retailing, 95(2), 3-18.
https://doi.org/10.1016/j.jretai.2018.10.001
4. Choi, J., & Lee, S. (2020). The impact of digital technologies on retail
operations and performance. Retail and Consumer Studies Journal, 24(1),
45-59. https://doi.org/10.1108/RCSJ-01-2019-0032
Websites:
5. Retail Management Association. (2023, March 22). The evolving role of
technology in retail management. Retrieved from
https://www.retailmanagement.org/technology-in-retail
6. Investopedia. (2024, January 10). What is retail management?. Retrieved
from https://www.investopedia.com/terms/r/retail-management.asp
Reports:
7. Deloitte. (2023). Global retail trends: A report on emerging consumer
behaviors. Deloitte Insights. Retrieved from
https://www.deloitte.com/global-retail-trends
31