SREE BUDDHA CENTRAL SCHOOL
KARUNAGAPALLY
(AFFILIATED TO CENTRAL BOARD OF SECONDARY EDUCATION, DELHI)
STOCK MANAGEMENT
A PROJECT WORK ON COMPUTER SCIENCE
SUBMITTED TO : CENTRAL BOARD OF
SECONDARY EDUCATION
NAME OF THE STUDENT :
YEAR OF SUBMISSON :
CBSE [Link] :
VALUED BY :
Certified Bonafide
Teachers in charge:
Smt. Jayasree R
CERTIFICATE
THIS IS TO CERTIFIY THAT THIS PROJECT WORK
ENTITLED “STOCK MANAGEMENT” IS A
BONAFIDE RECORD OF PROJECT WORK DONE BY
TOWARDS THE PARTIAL FULFILLMENT OF
REQUIREMENT OF STANDARD XII PRESCRIBED
UNDER THE CBSE SYLLABUS.
Teacher in charge:
Smt. Jayasree R
ACKNOWLEGEMENT
With sincere gratitude, I acknowledge the
help and guidance extended by my Computer
teacher Smt. Jayasree for the completion of
this project work successfully.
I am grateful to the Almighty and also extend
my thanks towards our principal Sri.
Vijayakumar K and Vice-principals Smt.
Jayashree Ramachandran and Smt. Girija
S and all other teachers of my school for the
blessings that they bestowed on me during
my studies.
Finally, I thank all my near and dear for their
support and encouragement.
CONTENTS
1 Introduction
2 Basic modules
3 Survey of technologies
4 Software & Hardware Requirements
5 Source Code
6 Output screen
7 Conclusion
8 Bibliography
INTRODUCTION
Stock management is an important
application of technology for efficient
operations of businesses across various
industries. It involves the strategic planning,
organization, and control of a company's
inventory. By effectively managing stock
levels, businesses can ensure they have the
right products available at the right time,
minimizing costs associated with excess
inventory or stockouts. This crucial function
not only optimizes cash flow but also directly
impacts customer satisfaction and
profitability. The Stock Management System
project represents a critical tool in modern
business operations, enabling organizations
to efficiently handle and control their
inventory.
Leveraging the power of Python and MySQL,
this project offers a robust platform for
businesses to streamline their stock
management processes. With features like
product addition and stock viewing, it
provides a user-friendly interface for both
input and retrieval of vital stock information.
This project addresses the fundamental
challenge of maintaining an optimal balance
between product availability and cost-
effectiveness, making it an essential tool
for enterprises seeking to enhance their
operational efficiency.
The foundation of this Stock Management
System lies in a MySQL database. This
database, named "school," serves as the
repository for all critical stock-related
information. It includes tables like "stock" to
store essential product details such as
product ID, name, quantity, and price. By
structuring the data in this manner, the
system can efficiently organize and manage
the inventory, ensuring that businesses can
make well-informed decisions about product
procurement, sales, and restocking. The
robustness of the database design ensures
data integrity and provides a solid foundation
for future scalability
BASIC MODULES
Stock Management is divided into following
modules as per their functionality:
1. Adding a product to database:
This module is used to add product details to
the database. User can enter the details like
Product id, Product name, Quantity of
products and product price to the database.
Once the details are successfully added
"Product added successfully!" will be shown
as feedback.
This module has implemented through a user
defined function add_product():
2. Viewing details of products:
This module is used to view details of
products which are already in the database.
This module has implemented through a user
defined function
view_stock():
SURVEY OF
TECHNOLOGIES
The following software are used for the
development of this project.
1. PYTHON: programming Python is an
interpreter, high-level, general-purpose
language developed by Guido van Rossum
in 1991. Python is dynamically typed and
garbage-collected. It supports multiple
programming paradigms, including
procedural, object-oriented, and functional
programming. Python is often described as
a "Batteries Included" language due to its
comprehensive standard library.
There are two major Python versions - Python
2 and Python 3. The version used for this
project is PYTHON 3.7.3
2. MY SQL: My SQL is an open-source
relational database management system
(RDBMS). My SQL is free and open-source
software under the terms of the GNU
General Public License. It is the world's
most popular open source database. With
its proven performance, reliability, and
ease-of use, My SQL has become the
leading database choice for web-based
applications, used by high profile web
properties including Face book, Twitter,
YouTube etc.
[Link] SQL-Connector-Python: Python
needs a My SQL driver to access the My SQL
database. This is a driver "My SQL
Connector" used to connect python and
Mysql databases. We can install this
connector using PIP command. pip install
mysql-connector-python.
SOFTWARE &
HARDWARE
specification
HARDWARE SPECIFICATION :
PROCESSOR : PENTIUM DUAL CORE or
Above
RAM : 1 GB
HARD DISK : 40 GB
SOFTWARE SPECIFICATION :
PLATFORM : Python IDLE 3.8
DATABASE : MySQL
LANGUAGES : Python
Source code
import [Link]
# To establish a database connection
db = [Link](
host="localhost",
user="root",
password="password",
database="school"
)
cursor = [Link]()
# Function to add a product to the database
def add_product():
product_ID = input("Enter product ID: ")
product_name = input("Enter product name: ")
quantity = int(input("Enter quantity: "))
price = float(input("Enter price: "))
[Link]("INSERT INTO stock
(product_ID, product_name, quantity, price)
VALUES (%s, %s, %s, %s)",
(product_ID, product_name, quantity,
price))
[Link]()
print("Product added successfully!")
# Function to view product details
def view_stock():
[Link]("SELECT * FROM stock")
results = [Link]()
print("\n")
print("ID", "Product Name", "Quantity", "Price",
sep='\t')
for row in results:
print(row[0], row[1], row[2], row[3], sep="\
t")
# Main program
while True:
print("\nStock Management System")
print("1. Add Product")
print("2. View Stock")
print("3. Exit")
choice = input("Enter your choice: ")
if choice == '1':
add_product()
elif choice == '2':
view_stock()
elif choice == '3':
print('Exiting the program')
break
else:
print("Invalid choice. Please try again.")
[Link]()
OUTPUT
Stock Management System
1. Add Product
2. View Stock
3. Exit
Enter your choice: 2
ID Product Name Quantity Price
1 Product A 10 9.99
2 Product B 20 19.99
Stock Management System
1. Add Product
2. View Stock
3. Exit
Enter your choice: 1
Enter product ID: 3
Enter product name: Product C
Enter quantity: 15
Enter price: 14.99
Product added successfully!
Stock Management System
1. Add Product
2. View Stock
3. Exit
Enter your choice: 2
ID Product Name Quantity Price
1 Product A 10 9.99
2 Product B 20 19.99
3 Product C 15 14.99
Stock Management System
1. Add Product
2. View Stock
3. Exit
Enter your choice: 3
Exiting the program
Data base description
CONCLUSION
We have much delighted and relieved with the
successful completion of our project. We have
made a small attempt in developing a
computer based solution for Stock
Management. This project helped us in
understanding the basic principles behind the
operations involved within Python-MySQL
project environment.
We tested code for Stock Management and is
found to be working satisfactorily and no
serious errors are spotted. Hence this
software project has been developed to fulfill
the academic learning in CBSE Class XII,
computer science curriculum
BIBLIOGRAPHY
WEBSITES
1. [Link]
2. [Link]
management/bank management
introduction html
3. [Link]
4. [Link]
BOOKS
1. Think Python - Allen B Downey
2. Python Programming for Beginners -
Jason Cannon