SIVANTHI PUBLIC
SCHOOL
Project Report
On
Shop Billing and Inventory
Management System
Computer science (083)
[As a part of the computer Science Course (083)]
:SUBMITTED BY:
NAME :
CLASS :
REGISTRATION NO :
SIVANTHI PUBLIC SCHOOL
Kundrathur, Metha Nagar, Chennai
69
BONAFIDE CERTIFICATE
Certified to be the bonafide project done by Master / Miss
Of class XII, during the academic year 2025-2026.
Date: Project Coordinator In-charge Teacher
[Mrs.R. LathaMaheswari] [SenthilKumar SR]
Submitted for All India Senior Secondary Practical Examination held for the
Subject “ COMPUTER SCIENCE - (083)” on ________________ at Sivanthi
Public School, Kundrathur, Chennai – 600 069.
Internal Examiner Principal External Examiner
CONTENT
S.N PG. Teach
O DESCRIPTION No er
Sign
1 ACKNOWLEDGEMENT
2 OVER VIEW OF PYTHON
3. OVER VIEW OF MySQL
4. INTRODUCTION
5. ABSTRACT
6. IMPORTED FILES AND MODULES
7. USED FUNCTIONS / METHODS
8. BENEFITS OF YOUR PROJECT
9. HARDWARE AND SOFTWARE
REQUIREMENTS
10. USED TABLES
11. SOURCE CODE
12. OUTPUT
13. CONCLUTION
14. BIBLIOGRAPHY
SIVANTHI PUBLIC SCHOOL
Kundrathur, Metha Nagar, Chennai 69
ACKNOWLEDGEMENT
I would like to express my greatest appreciation to all
individuals who have helped and supported me throughout
the project. I am thankful to my Computer Science
teachers for their ongoing support during the project, from
initial advice, and encouragement, which led to the final
report of this project.
I would also like to thank Mrs. <PRINCIPAL> Who was
always there in our project.
A special acknowledgement goes to my classmates who
helped me in completing the project by exchanging
interesting business logic and sharing their experience.
I wish to thank my parents as well for their undivided
support and interest who inspired me and encourage me to
go my way, without whom I would be unable to complete
my project. At the end, I want to thank my friends who
displayed appreciation to my work and motivated me to
continue my work.
OVERVIEW OF PYTHON
PYTHON IS A HIGH-LEVEL, INTERPRETED, INTERACTIVE AND
OBJECT-ORIENTED SCRIPTING LANGUAGE. PYTHON IS
DESIGNED TO BE HIGHLY READABLE. IT USES EHGLISH
KEYWORDS FREQUENTLY WHERE AS OTHER LANGAUGES
USE PUNCTUATION, AND IT HAS FEWER SYNTACTICAL
CONSTRUCTION THAN THE OTHER LANGUAGES.
GUIDO VAN ROSSUM CONCEIVED PYTHON IN THE LATE
1980’S. IT WAS RELEASED IN 1991 AT CENTRUM WISKUNDE &
INFORMATIC (CWI) IN THE NETHERLAND AS A SUCCESSOR OF
THE ABC LANGUAGE.
INTERPRETED LANGAUGE: PYTHON IS PROCESSED AT
RUNTIME BY PYTHON INTERPRETER.
OBJECT-ORIENTED LANGUAGE: IT SUPPORTS OBJECT
ORIENTED FEATURES AND TECHNIQUES OF
PROGRAMMING.
INTERACTIVE PROGRAMMING LANGUAGRE: USERS
CAN INTERECT WITH THE PYTHON INTERPRTER
DIRECTLY FOR WRITING PROGRAMS.
EASY LANGUAGE: PYTHON IS EASY TO LEARN,
ESPECIALLY FOR BEGINNERS.
STRAIGHT FORWARD SYNTAX: THE FORMATION OF
PYTHON IS SIMPLE AND STRAIGHT FORWARD, WHICH
ALSO MAKES IT POPULAR.
EXTENDABLE: USERS CAN ADD LOW LEVEL MODULES
TO PYTHON INTERPRETER.
PORTABLE: PYTHON CODES CAN BE RUN ON A WIDE
VARIETY OF HARDWARE PLATFORM HAVING THE SAME
INTERFACE.
PYTHON IS USED TO CREATE WEB AND DESKTOP
APPLICATIONS, AND SOME OF THE MOST POPULAR WEB
APPLICATION LIKE INSTAGRAM, YOUTUBE, SPTIFY, ALL
HAVE BEEN DEVELOPED IN PYTHON.
PYTHON IS AN EASY TO LEARN, POWERFUL PROGRAMMING
LANGAUGE. IT HAS EFFECTIVE HIGH –LEVEL DATA
STRUCTURES AND SIMPLE BUT EFFECTIVE APPROACH TO
OBJECT-ORIENTED PROGRAMMING. PYTHON’S ELEGANT
SYNTAX AND DYNAMIC TYPING, TOGETHER WITH ITS
INTERPRETER NATURE, MAKE IT AN IDEAL LANGUAGE FOR
SCRIPTING AND RAPID APPLICATION DEVELOPMENT IN
MANY AREAS ON MOST PLATFORMS.
THE PYTHON INTERPRETER AND EXTENSIVE STANDARD
LIBRARY ARE FREELY AVAILABLE IN SOURCE OR BINARY
FORM FOR ALL MAJOR PLATFORM FRON THE PYTHON WEB
SITE HTTPS:\\[Link]\, AND MAY BE FREEY
DISTRUDUTED. THE SAME SITE ALSO CONTAINS
DISTRIBUTIONS OF AND POINTERS TO MANY FREE THIRD
PARTY PYTHON MODULES, PROGRAMS AND TOOLS, AND
ADDITIONAL DOCUMENTATION.
THE PYTHON INTERPRETER IS EASILY EXTENDED WITH NEW
FUNCTIONS AND DATA TYPES IMPLEMENTED IN C OR C++.(OR
OTHER LANGUAGES CALLABLE FROM C). PYTHON IS ALSO
SUITABLE AS AN EXTENSION LANGUAGE FOR
CUSTOMIZABLE APPLICATIONS.
OVERVIEW OF MySQL
MySQL IS OPEN-SOURCE RELATIONAL DATABASE
MANAGEMENT SYSTEM(RDBMS). The NAME IS THE
COMBINATION OF “My” THE NAME OF CO-FOUNDER
MICHAEL WIDENIUS DAUGHTER, AND “SQL”, THE
ABBREVIATION FOR STRUCTURED QUERY LANGAUGE.
MySQL FREE AND OPEN SOURCE SOFTWARE UNDER THE
TERM OF THE GNU GENERAL PUBLIC LICENCE, AND IS
ALSO AVAILIABLE UNDER A VARIETY OF PROPRIETARY
LICENSES. MySQL WAS OWNED AND SPONSORED BY THE
SWDISH COMPANY MySQLAB, WHICH WAS BROUGHT BY
THE SUM MICROSYSTEMS.(NOW ORACLE CORPORATION).
IN 2010, WHEN ORACLE ACQUIRED SUN, WIDENIUS
FORKED THE OPEN SOURCE MySQL PROJECT TO CREATE
MARIADB. MySQL IS A COMPONENT OF LAMP WEB
APPLICATION SOFTWARE STACK, WHICH IS AN ACRONYM
FOR LINUX, APACHE, MySQL, PERL/PHP/PYTHON. MySQL IS
USED BY MANY DATABASE DRIVEN WEB APPLICATIONS,
INCLUDING DURPAL, JOOMAL, PHB BB, AND WORDPRESS.
MySQL IS ALSO USED BY MANY POPULAR WEBSITES,
INCLUDING FACE BOOK, TWITTER AND YOUTUBE.
THE MySQL SERVER SOFTWARE ITSELF AND THE CLIENT
LIBRARIES USE DUAL LICENSING DISTRIBUTION. THEY ARE
OFFERED UNDER GPL VERSION 2, OR A PROPRIETARY
LICENCE. SUPPORT CAN BE OBTAINED FROM THE OFFICAL
MANUAL. FREE SUPPORT ADDITIONALLY IS AVAILIABLE IN
DIFFERENT IRC CHANNELS AND FOURMS. ORACLE OFFERS
PAID SUPPORT VIA ITS MySQL ENTERPRISES PRODUCTS.
THEY DIFFER IN THE SCOPE OF SERVICESS AND IN PRICE.
ADDITIONALLY, A NUMBER OF THIRD PARTY
ORGANIZATIONS EXIST TO PROVIDE SUPPORT AND
SERVICES, INCLUDING MARIA DB AND PERCONA. MySQL
HAS RECEIVED POSITIVE REVIEWS, AND REVIEWERS
NOTICED IT “PERFORMS EXTERMELY WELL IN THE
AVERAGE CASE” AND THAT THE “DEVELOPER INTERFACES
ARE THERE, AND THE DOCUMENTATION(NOT TO MENTION
FEEDBACK IN THE REAL WORLD VIA SITES AND LIKE) IS
VERY , VERY GOOD”. IT HAS ALSO BEEN TESTED TO BE A
“FAST, STABLE AND TRUE MULTI-THREADED SQL
DATABASE SERVER”.
INTRODUCTION
This project was done in group of three students Named
Sharath, Sivanesh, Harish raj, based on Shop Billing and
Inventory Management System
DBMS:
The software required for the management of data is
called as DBMS. It has 3 models.
(a) Relation Model
(b) Hierarchial Model
(c) Network Model
RELATIONAL MODEL:
It is based on the concept on relation. Relation is the
table that consists of rows and columns. The rows of the
table are called tuples and the columns of the table are
called attribute. Numbers of rows in the table is called as
cardinality. Number of columns in the table is called as
degree.
HIERAECHICAL MODEL:
In this type of model, we have multiple records for each
record. Aparticular record has one parent record. No child
record can exist without parent record. In this, the
records are organized in tree like structure.
NETWORK MODEL:
In this, the data is represented by collection of records and
relationship is represented by association.
CHARACTERISTICS OF DBMS:
It reduces the redundancy
Reduction of data in inconsistency
Data sharing
Data standardization
DIFFERENT TYPES OF FILES BASED ON ACCESS:
Sequential file
Serial file
Random(direct access) file
Text file
Binary file
ABSTRACT
KEY OBJECTIVES OF THE SHOP BILLING SYSTEM:
To automate the billing process
The main objective is to replace manual billing with a
computerized system for faster and accurate bill
generation.
To maintain item details using a database
To store and manage item information such as item
ID, name, category, price, and stock using MySQL.
To reduce manual calculation errors
To automatically calculate item-wise total and grand
total, avoiding human errors.
To manage stock efficiently
To check stock availability before purchase and
update stock quantities automatically after each
transaction.
To provide quick item search and selection
To allow users to search items easily by name and
view items category-wise.
To ensure data accuracy and consistency
To maintain correct and up-to-date information in the
database after every purchase.
To improve efficiency and save time
To speed up the billing and inventory process in small
and medium-scale shops.
To handle errors effectively
To use exception handling for managing invalid inputs
and database-related errors.
To provide a user-friendly interface
To design a simple, menu-driven interface that is easy
to use even for beginners.
CORE FEATURES OF THE SHOP BILLING SYSTEM:
Menu-Driven Application
Provides a simple and interactive menu that allows
users to perform operations easily without technical
knowledge.
Python–MySQL Integration
Connects Python with MySQL to store, retrieve, and
update shop data permanently.
Item Management System
Displays item details such as item ID, name, category,
price, and available stock.
Category-Wise Item Viewing
Allows users to view products based on categories like
Electronics, Grocery, and Dresses.
Search Functionality
Enables searching items by name using partial
matching for quick access.
Purchase Processing
Handles item purchases by accepting item ID and
quantity from the user.
Automatic Stock Update
Updates item stock automatically in the database
after each successful purchase.
Accurate Bill Generation
Calculates item-wise total and grand total without
manual errors.
Payment Handling
Accepts cash input from the customer and calculates
the balance amount.
Exception Handling
Manages invalid inputs and database errors to ensure
smooth execution.
Database Security and Consistency
Maintains consistent and accurate data through
proper database operations.
USES OF THE SHOP BILLING SYSTEM:
Used in small retail shops
This system can be used in small shops to perform
billing and manage daily sales easily.
Used for quick and accurate billing
Helps in generating bills faster and avoids manual
calculation errors.
Used for inventory management
Maintains stock details and updates item quantity
automatically after every purchase.
Used to reduce manual work
Minimizes paperwork and human effort by automating
the billing process.
Used to save time
Speeds up the billing and checkout process, especially
during busy hours.
Used for maintaining sales records
Stores purchase-related data temporarily during
billing for accurate bill generation.
Used for learning database applications
Useful for students to understand Python–MySQL
connectivity and real-time database operations.
Used in educational projects
Can be implemented as a mini project or school-level
project in computer science.
Used to improve customer experience
Provides clear bills with item-wise details and correct
balance calculation.
SOFTWARE AND HARDWARE REQUIREMENTS
1 Operating Windows 10 Pro
System
2 Core i3 10th Gen Processor
Processor
Gigabyte MotherBoard-
3
Mother Board intel-Chipset
4 4 Gb
RAM
5 3.10
Python Version
6 MySQL Version 8.0
DBMS
SOFTWARE USED FOR THE DEVELOPMENT
OF SHOP BILLING AND INVENTORY
MANAGEMENT SYSTEM
Integrated Environment Tools Used:
Python 3.10
MySQL 8.0
Developed At
SIVANTHI PUBLIC SCHOOL, KUNDRATHUR
CHENNAI
SOURCE CODE:
import [Link]
# ---------------- CONNECT TO MYSQL ----------------
conn = [Link](
host="localhost",
user="root",
password="kcsharath1329",
database="shop"
)
cursor = [Link]()
# ---------------- CREATE CUSTOMER TABLE
----------------
[Link]("""
CREATE TABLE IF NOT EXISTS customer (
cid INT PRIMARY KEY,
name VARCHAR(50),
phone VARCHAR(15)
)
""")
[Link]()
# ---------------- BILL & CUSTOMER DATA ----------------
bill = []
customer = {}
# ---------------- VIEW ITEMS ----------------
def view_items(category=None):
if category:
[Link]("SELECT * FROM items WHERE
category=%s", (category,))
else:
[Link]("SELECT * FROM items")
rows = [Link]()
print("\nID | Name | Category | Price
| Stock")
print("-"*60)
for row in rows:
print(f"{row[0]:<3}| {row[1]:<20}|
{row[2]:<12}| ₹{row[3]:<7}| {row[4]}")
print()
# ---------------- CUSTOMER DETAILS ----------------
def get_customer_details():
try:
cid = int(input("Enter Customer ID: "))
name = input("Enter Customer Name: ")
phone = input("Enter Phone Number: ")
[Link](
"INSERT INTO customer VALUES (%s, %s,
%s)",
(cid, name, phone)
)
[Link]()
customer['id'] = cid
customer['name'] = name
customer['phone'] = phone
print("Customer details saved successfully!")
except:
print("Error saving customer details!")
# ---------------- SEARCH ITEM ----------------
def search_item():
keyword = input("Enter item name to search: ")
[Link]("SELECT * FROM items WHERE
name LIKE %s", ('%' + keyword + '%',))
rows = [Link]()
if rows:
print("\nID | Name | Category |
Price | Stock")
print("-"*60)
for row in rows:
print(f"{row[0]:<3}| {row[1]:<20}|
{row[2]:<12}| ₹{row[3]:<7}| {row[4]}")
else:
print("No items found!")
# ---------------- PURCHASE ITEM ----------------
def purchase_item():
view_items()
try:
item_id = int(input("Enter item ID to purchase:
"))
quantity = int(input("Enter quantity: "))
except:
print("Invalid input!")
return
[Link]("SELECT name, stock, price FROM
items WHERE id=%s", (item_id,))
result = [Link]()
if result:
name, stock, price = result
if stock >= quantity:
total = price * quantity
new_stock = stock - quantity
[Link]("UPDATE items SET stock=
%s WHERE id=%s", (new_stock, item_id))
[Link]()
[Link]([name, quantity, price, total])
print(f"Purchased {quantity} x {name}")
else:
print("Not enough stock!")
else:
print("Invalid item ID!")
# ---------------- PRINT BILL ----------------
def print_bill():
if not bill:
print("No items purchased!")
return
print("\n=========== FINAL BILL
===========")
print("Customer Name :", [Link]('name',
'Not Entered'))
print("Phone Number :", [Link]('phone',
'Not Entered'))
print("---------------------------------------")
print("Item Qty Price Total")
grand = 0
for item in bill:
print(f"{item[0]:<20} {item[1]:<5} ₹
{item[2]:<7} ₹{item[3]}")
grand += item[3]
print("---------------------------------------")
print(f"Grand Total: ₹{grand}")
print("===========================
============")
print("Thank you! Visit again 😊")
# ---------------- MENU ----------------
while True:
print("\n===== CUSTOMER SHOP MENU
=====")
print("0. Enter Customer Details")
print("1. View All Items")
print("2. View Electronics")
print("3. View Grocery")
print("4. View Dresses")
print("5. Search Item")
print("6. Purchase Item")
print("7. Exit & Print Bill")
choice = input("Enter choice: ")
if choice == '0':
get_customer_details()
elif choice == '1':
view_items()
elif choice == '2':
view_items("Electronics")
elif choice == '3':
view_items("Grocery")
elif choice == '4':
view_items("Dresses")
elif choice == '5':
search_item()
elif choice == '6':
purchase_item()
elif choice == '7':
print_bill()
break
else:
print("Invalid choice!")
[Link]()
[Link]()
OUTPUT AND TABLES USED
PYTHON OUTPUTS:
[Link] details
[Link] all items in the shop
[Link] viewing category electronics
4. for viewing category grocery
5. for viewing category dresses
[Link] searching items in the shop
7. purchasing things
[Link] and billing
Tables used
[Link]
[Link] details
BIBLIOGRAPHY
BOOKS:-
COMPUTER SCIENCE WITH PYTHON – Sumita Arora
WEBSITES:-
[Link]
[Link]
[Link]
[Link]
CONCLUTION
The Shop Billing System using Python and
MySQL successfully automates the billing and
inventory management process of a retail shop. The
system provides a simple, menu-driven interface
that allows users to view items, search products,
purchase items, and generate an accurate final bill.
By integrating Python with MySQL, the application
ensures permanent storage of item details and real-
time updating of stock after every purchase.
The use of exception handling makes the system
reliable by preventing crashes due to invalid inputs
or database errors. Automatic calculation of totals
and grand total reduces manual effort and
eliminates calculation mistakes. This project
improves efficiency, saves time, and enhances
accuracy in shop operations.
Overall, this project demonstrates the practical
application of Python programming, database
connectivity, and basic inventory management
concepts. It is user-friendly, cost-effective, and
highly suitable for small-scale retail shops as well as
educational purposes.