Supermarket Management System
Supermarket Management System
10 output 15
11 Bibliography 16
P a g e 1 | 17
Supermarket
Management System
1.Introduction:
The Supermarket Management System is a software
application designed to manage the daily operations of a
supermarket. The system aims to provide an efficient and
organized way to manage products, customers, and sales. The
system will allow users to add, update, and delete products,
customers, and sales records, as well as view inventory and
sales reports.
Project Overview
The Supermarket Management System is a Python-based
application that utilizes a MySQL database to store and manage
data. The system will provide a user-friendly interface for
supermarket staff to perform various tasks, including:
Managing inventory and stock levels
Processing sales and transactions
Managing customer information and loyalty programs
Generating reports and analytics
Target Audience
The target audience for the Supermarket Management
System includes:
Supermarket owners and managers
Store staff and employees
Customers and loyalty program members
P a g e 2 | 17
Project Scope
The scope of the Supermarket Management System includes:
Designing and developing the software application
Implementing the MySQL database
Testing and quality assurance
Deployment and maintenance
2.FEASIBILITY STUDY:
1.Economic Feasibility:
The economic feasibility of the Supermarket Management
System is also high. The system will provide a range of
benefits, including:
1. Improved efficiency: The system will automate many of
the manual processes, reducing the need for manual labor
and improving efficiency.
2. Increased accuracy: The system will reduce the risk of
human error, improving the accuracy of the data and the
overall quality of the service.
3. Cost savings: The system will reduce the need for paper-
based records and manual data entry, reducing costs and
improving profitability.
4. Improved customer service: The system will provide a
range of features that will improve the customer
experience, including online ordering and payment.
2.Technical Feasibility:
P a g e 3 | 17
The technical feasibility of the Supermarket Management
System is high. The system can be developed using a
range of technologies, including Python, MySQL, and HTML/CSS.
The system will require a robust database management
system to store and manage the data, and a user-friendly
interface to interact with the system.
3.Objectives:
To design and develop a user-friendly supermarket
management system
To provide an efficient way to manage products,
customers, and sales
To generate reports on inventory and sales
To improve the overall management of the supermarket
4.Proposed System:
The proposed system is a Python-based application that
uses the MySQL database management system to store data.
The system consists of the following modules:
Product Management: allows users to add, update, and
delete products
Customer Management: allows users to add, update, and
delete customers
Sales Management : allows users to record sales and view
sales reports
Inventory Management : allows users to view inventory
reports
5.System Design:
P a g e 4 | 17
The system design consists of the following
components:
Database Design:
Products table: product_id, product_name,
product_description, price, quantity
Customers table: customer_id, customer_name,
customer_address, customer_phone
Sales table: sale_id, product_id, quantity_sold
Entity-Relationship Model: The database design is
based on the entity-relationship model, where each
table represents an entity (e.g., products, sales,
customers) and the relationships between them are
established through foreign keys.
Normalization: The database design follows the
principles of normalization, which ensures that each
piece of data is stored in one place and one place
only, reducing data redundancy and improving data
integrity.
P a g e 5 | 17
3. Error Codes: These codes are used to identify
specific errors that occur during the execution of
the code.
4. Error Messages: These messages are used to inform
the user of any errors that occur during the
execution of the code.
Error Messages
Error messages are used to inform the user of any
errors that occur during the execution of the code.
There are several types of error messages,
including:
1. Error Codes: These codes are used to identify
specific errors that occur during the execution of
the code.
2. Error Descriptions: These descriptions are used to
provide a detailed explanation of the error that
occurred.
3. Error Solutions: These solutions are used to provide
a solution to the error that occurred.
Error Logging
Error logging is the process of recording errors that
occur during the execution of the code. There are
several types of error logging, including:
1. Error Log Files: These files are used to record errors
that occur during the execution of the code.
2. Error Databases: These databases are used to
record errors that occur during the execution of the
code.
3. Error Reporting Tools: These tools are used to
report errors that occur during the execution of the
code.
Common Error Handling Mistakes
P a g e 6 | 17
There are several common error handling mistakes,
including:
1. Not Catching Exceptions: Not catching exceptions
can cause the system to crash or produce
unexpected results.
2. Not Providing Detailed Error Messages: Not
providing detailed error messages can make it
difficult for the user to understand the error that
occurred.
3. Not Logging Errors: Not logging errors can make it
difficult to track and analyze errors that occur
during system operation.
4. Not Testing Error Handling: Not testing error
handling can cause errors to occur during system
operation.
7.System Architecture:
The system uses a Python script to interact with the
MySQL database
The system uses a command-line interface to
interact with the user
8.Requirements:
Python 3.x
MySQL Connector/Python
MySQL database management system
Windows 10 or 11
9.Source Code:
SQL CODE :
P a g e 7 | 17
CREATE TABLE products (
product_name VARCHAR(255),
product_description VARCHAR(255),
quantity INT,
);
product_id INT,
quantity_sold INT,
);
customer_name VARCHAR(255),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
);
PYTHON CODE :
P a g e 8 | 17
import mysql.connector
class SupermarketManagementSystem:
def __init__(self):
self.cnx = mysql.connector.connect(
host="localhost",
database="supermarket"
self.cursor = self.cnx.cursor()
try:
self.cursor.execute(query, params)
self.cnx.commit()
print("Error: {}".format(err))
def add_product(self):
while True:
try:
break
except ValueError:
P a g e 9 | 17
while True:
try:
break
except ValueError:
def update_product(self):
while True:
try:
break
except ValueError:
while True:
try:
break
except ValueError:
P a g e 10 | 17
def delete_product(self):
while True:
try:
break
except ValueError:
self.execute_query(query, (product_id,))
def view_inventory(self):
try:
self.cursor.execute(query)
result = self.cursor.fetchall()
print(f"Product ID: {row[0]}, Name: {row[1]}, Description: {row[2]}, Price: {row[3]}, Quantity:
{row[4]}")
print("Error: {}".format(err))
def record_sale(self):
while True:
try:
break
except ValueError:
P a g e 11 | 17
print("Invalid product ID. Please enter a valid number.")
while True:
try:
break
except ValueError:
def view_sales_report(self):
try:
self.cursor.execute(query)
result = self.cursor.fetchall()
print("Error: {}".format(err))
def add_customer(self):
def update_customer(self):
while True:
try:
break
except ValueError:
def delete_customer(self):
while True:
try:
break
except ValueError:
self.execute_query(query, (customer_id,))
P a g e 13 | 17
def view_customers(self):
try:
self.cursor.execute(query)
result = self.cursor.fetchall()
print("Error: {}".format(err))
def main():
system = SupermarketManagementSystem()
while True:
print("11. Exit")
if choice == "1":
P a g e 14 | 17
system.add_product()
system.update_product()
system.delete_product()
system.view_inventory()
system.record_sale()
system.view_sales_report()
system.add_customer()
system.update_customer()
system.delete_customer()
system.view_customers()
break
else:
if __name__ == "__main__":
main()
10.Output :
P a g e 15 | 17
1. Add Product
2. Update Product
3. Delete Product
4. View Inventory
5. Record Sale
7. Add Customer
8. Update Customer
9. Delete Customer
11. Exit
11.Bibliography:
Computer science book -class 12 &11
Google
https://www.geeksforgeeks.org
P a g e 16 | 17
P a g e 17 | 17