0% found this document useful (0 votes)
1K views

Stock Import Management System: Name-Aditya Gupta CLASS-12-B Board Roll Number-23669774

This document describes a student project on a stock import management system created by Aditya Gupta for his class 12 certification. The project uses Python and MySQL to create a database of stock import records that allows the user to add, update, delete and view stock import data. The coding section explains the functions for connecting to the database and implementing the four main operations. Sample outputs are provided for adding, updating, deleting and viewing records stored in the database table.

Uploaded by

Aman Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Stock Import Management System: Name-Aditya Gupta CLASS-12-B Board Roll Number-23669774

This document describes a student project on a stock import management system created by Aditya Gupta for his class 12 certification. The project uses Python and MySQL to create a database of stock import records that allows the user to add, update, delete and view stock import data. The coding section explains the functions for connecting to the database and implementing the four main operations. Sample outputs are provided for adding, updating, deleting and viewing records stored in the database table.

Uploaded by

Aman Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

SESSION-2021-2022

STOCK IMPORT MANAGEMENT SYSTEM

NAME-ADITYA GUPTA
CLASS-12-B
board roll number-23669774
CERTIFICATE

This is to certify that this project on topic


“ Stock import MANAGMENT SYSTEM ”
has been made by ADITYA GUPTA of student of
class XII – SEC of B

“ Shree Sanatan Dharm Education Centre “


during the academic year 2021-22.
He has made this project under my guidance with
utmost sincerity

_______________ _______________
External teacher Internal teacher

_______________
Principal
ACKNOWLDGEMENT

I would like to convey my heartfelt thanks to

M s. Shobha Das

my school Principal for providing us with


necessary resources and

M r. Dinesh Maurya
my Computer Science Teacher,

who gave valuable suggestions and guidelines for


completion of my project.

My project has been a success only because of


guidelines.

ADITYA GUPTA
XII-“SECTION”-B
Board Roll No : 23669774
INDEX

➢ CERTIFICATE
➢ ACKNOWLDGEMENT
➢ INTRODUCTION
• BENIFITS OF STOCK IMPORTS SYSTEM
➢ SYNOPSIS
➢ CODING
➢ OUTPUT
➢ BIBLIOGRAPHY
INTRODUCTION OF MY PROJECT

The Benefits Of Using An STOCK Inventory


Management System (2021).
• Simplified inventory management. ...
• Reduced risk of overselling. ...
• Greater cost-savings. ...
• Avoidance of stock-outs and excess stock. ...
• Improved business negotiations. ...
• Better product visibility in the event of a recall
SYNOPSIS

TOPIC:-STOCK IMPORT MANAGMENT


SYSTEM
OVERVIEW:-
STOCKS IMPORT DETAILS are majorly important for our
country as it helps us to manage with stock inputs and
updates us about the import MATERIALS and the total
expenditure .This saves our lot of time for doing the
relative working for updating the details of stocks
imported.
LANGUAGE USED:-
This project is made using Python as the coding
language.
CONCEPT USED:-
Python MySQL connectivity is used for storing
details as a database.
MODULES USED:-
• MYSQL
• visual studio code
• My SQL. connector
PRE-REQUISTIES:-
You must have the following Soft wares for the
successful running of this software:-
1 Python (Version 3 or above) must be
installed(or the latest version) . It is
downloadable from “www.python.org”.
• MySQL 8.0 Command Line Client must be
installed. It is downloadable from
“www.mysql.org”.
WORKING
MY PROGRAM IS BASICALLY A CONNECTIVITY DATABASE
PROGRAM AS
IT HAS 4 OPTIONS
1 .WHEN WE SELECT FIRST OPTION IT ADDS THE
RECORDS
2 .UPDATES THE VALUES ALREADY EXISTING IN THE
STOCK WHEN WE CHOOSE 2 OPTION
3 .OPTION 3 DELETES THE RECORD EXISTING IN THE
STOCK TABLE
4. OPTION 4 DISPLAYS ALL THE RECORDS ENTERED
IN THE TABLE
CODING
#IMPORTS PY MYSQL MODULE
import pymysql
#CONNECTING DATABASE
def dbconnect():
return pymysql.connect(host="localhost",
user="root", password='79851528sg',
database='stocksin2020')
def menu():
retry = 'y'
while retry.lower() == 'y':
database = dbconnect()
cursor = database.cursor()
print('1. add record\n2. update
record\n3. delete record\n4. display records')
#ASKS USER HIS CHOICE
choice = int(input('\nEnter your choice:
').strip())
# DESCRIPTION OF EACH CHOICE
if choice== 1:
adddata(database, cursor)
elif choice== 2:
updatedata(database, cursor)
elif choice== 3:
deletedata(database, cursor)
elif choice== 4:
fetchdata(database, cursor)
else:
print("Invalid input")
retry = input("\n Do you want to
continue or not: ")
#DEFINING THE WORK OF ADD DATA FUNCTION
def adddata(database, cursor):
cursor.execute('create table if not exists
imports(SNo int PRIMARY KEY, ProductName
varchar(255), Units int, Expenditure int)')
cursor.execute('select * from imports')
#FETCHES ALL RECORDS FROM THE DATABASE
data = cursor.fetchall()
if len(data) > 0:
sNo = data[len(data)-1][0] + 1
else:
sNo = 1
product = input('Product Name: ').strip()
units = int(input('Number of units: ').strip())
exp = int(input('Expenditure of 1 unit:
').strip())
total = exp * units
cursor.execute(f'insert into imports
values({sNo}, \'{product}\', {units}, {total})')
database.commit()
print(f'Record added:\n{sNo}, {product},
{units}, {total}')
#DEFINING WORK OF UPDATE DATA FUNCTION
def updatedata(database, cursor):
product = input('Product Name: ').strip()
cursor.execute(f'select * from imports where
ProductName = "{product}"')
#FETCHES ONE RECORD FROM TABLE
data = cursor.fetchone()
sNo, units = data[0], data[2]
exp = int(input('Expenditure of 1 unit:
').strip())
#calculation of total expenditure of all units
total = exp * units
cursor.execute(f'update imports set
Expenditure = {total} where ProductName =
"{product}"')
database.commit()
print("Record updated")
#DEFINING WORK OF DELETE DATA FUNCTION
def delete data(database, cursor):
product = input('Product Name: ').strip()
#deletes the user specified record from the table
cursor.execute(f'delete from imports where
ProductName like "%{product}%"')
database.commit()
print("Record deleted")
def fetchdata(database, cursor):
#WE WRITE THAT CODE WHICH MAY CAUSE
# ERROR
try:
cursor.execute("select * from imports")
data = cursor.fetchall()
for record in data:
print(record)
except:
print("Error: Unable to fetch data")
connection = pymysql.connect(host="localhost",
user="root", password='79851528sg')
cursor = connection.cursor()
#CREATES TABLE IF IT DOES NOT EXISTS
cursor.execute('create database if not exists
stocksin2020')
menu()
OUTPUTS

OUTPUT-1 ADD A RECORD-


OUTPUT2-UPDATE THE RECORD

OUTPUT3-DELETE A RECORD

OUTPUT4-SHOW ALL RECORDS


BIBLIOGRAPHY

(Books Reference)
1.“Computer Science with Python”
by Sumita Arora.
2. “Information Practices with
Python” by Sumita Arora.
(Web Reference)
3. www.wikipedia.com
SPECIAL REFRENCE FROM GOOGLE .COM

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy