CS Project

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 60

PM SHRI KENDRIYA VIDYALAYA I.N.S.

HAMLA, MUMBAI
पि.एम श्री केन्द्रीय विद्यालय आईएनएस
हमला, मुंबई
COMPUTER SCIENCE
Investigatory Project
STOCK MANAGEMENT SYSTEM

ROLL NO : 12115
NAME :

CLASS : XII-A

SUBJECT : COMPUTER SCIENCE


SUB CODE : 083

1
PM SHRI KENDRIYA VIDYALAYA I.N.S. HAMLA, MUMBAI
पि.एम श्री केन्द्रीय विद्यालय आईएनएस हमला, मुंबई

Certificate
This is to certify that (Name) Roll.no 12115 has successfully completed the project synopsis Work entitled STOCK

MANAGEMENT in the subject Computer Science (083) laid down in the regulations of CBSE for the purpose of Practical

Examination (Term-1) in Class XII to be held in KV RHE PUNE-2021.

External Examiner Internal Examiner


Name: _______________ Mrs. SAVITA SHARMA Mrs. Madhulika Mitra Mishra

Desig: _______________ PGT (Computer Science) PRINCIPAL

2
SER DESCRIPTION PAGE NO

01 ACKNOWLEDGEMENT 04

05
02 STATEMENT ABOUT THE PROJECT

WHY IS THE PARTICULAR TOPIC CHOSEN?


03 07

OBJECTIVES AND SCOPE OF THE PROJECT


04 08

METHODOLOGY
05 10

HARDWARE AND SOFTWARE REQUIREMENTS


06 13

Source Code and Output


07 14

TABLE OF CONTENTS [ T O C ]
ACKNOWLEDGEMENT

3
Apart from the efforts of me, the success of any project depends largely on the encouragement and
guidelines of many others. I take this opportunity to express my gratitude to the people who have been
instrumental in the successful completion of this project.

I express deep sense of gratitude to almighty God for giving me strength for the successful completion of
the project.I express my heartfelt gratitude to my parents for constant encouragement while carrying out this
project.

I gratefully acknowledge the contribution of the individuals who contributed in bringing this project up to this
level, who continues to look after me despite my flaws, I express my deep sense of gratitude to the luminary The
Principal, MRS. MUDHULIKA MITRA of MISHRA KENDRIYA VIDYALAYA, INS HAMLA ,MUMBAI, who has
been continuously motivating and extending their helping hand to us. My sincere thanks to Mrs. SAVITA
SHARMA (PGT),COMPUTER SCIENCE TEACHER, A guide, Mentor all the above a friend,who critically
reviewed my project and helped in solving each and every problem, occurred during implementation of the
project

The guidance and support received from all the members who contributed and who are contributing to this
project, was vital for the success of the project. I am grateful for their constant support and help.

STATEMENT ABOUT THE PROJECT


4
The main objective of the python project on stock management is to manage the details of sales,
discounts, payments, products, and inventory digitally.

The project is totally built at administrative end and only administrator is guaranteed the access. The
purpose of the project is to build an application program to reduce the manual work for managing the sales,
discounts, stock, and payments. It tracks all the details about stocks, products, and inventory; it also prints
various reports as per input given by the user.

Advantages:-

 It generates the report on sales, discounts and stocks.


 Provides filter report on payments, inventory and products.
 We can easily export PDF on sales, products and stocks.
 Applications can also provide excel export for sales and discounts.
 It deals with monitoring the information and transaction of products.
 It increases the efficiency of managing sales and discount.
 It has higher efficiency of editing, adding and updating of records.
 Provides the searching facilities on various factors.

5
WHY IS THE PARTICULAR TOPIC CHOSEN?
The purpose of choosing this project is to computerise the data storage in MYSQL database using python.

made possible by using the python module.

The concepts discussed in this project will help us to make own application and add functionally to the

same.

This will be very handy when we are trying to create a customized application that is suited for our
personal needs. Over the decades computers and stock have developed gradually, changed with time, taste and
trend. But nobody knew that a time will come when both these fields will complement each other so well. Today
stock management has reached new heights by computer aided methods of design. As a result of which,
computer industry has got its new customer. Computer technology is making waves in the stock management
zone.

6
OBJECTIVES AND SCOPE OF THE PROJECT
The objective of this project is to let the students apply the programming knowledge into a real world

situation/problem and exposed the students how programming skills helps in developing a good software.

 Apply object oriented programming principles effectively when developing small to medium sized projects.

 Write effective procedural code to solve small to medium sized problems.

 Students will demonstrate a breadth of knowledge in computer science, as exemplified in the areas of

systems, theory and software development.

 Students will demonstrate ability to conduct a research or applied Computer Science project, requiring writing

and presentation skills which exemplify scholarly style in computer science.

 The purpose of the project is to build an application program to reduce the manual work for managing the

sales, discounts, stock, and payments.

7
METHODOLOGY
MODULES USED :

 MODULES:
The OS modules in python provides a way of using operating system dependent functionality . The
functions that OS module provides allow you to interface with the underlying operating system that python is
running on – be that Window, mac.

 MODULE MYSQL CONNECTION :


MySQL connection enables python programs to access MySQL databases, using an API that is compliant
with the python database API Specification v2.0 (pep 249). It also contains an implementation of the X
DevAPI.

 DATETIME :
The datetime module in python is used to access the current date and time of data entered in hardware,
operating system .

8
FUNCTIONS
 To Add product():

This function is used to add product details.

 To Edit product():

This function is used to edit product details.

 To Delete product():

This function is used to delete product.

 To Search product():

This function is used to search product.

 To Purchase product():

This function is used to purchase product.

 To View purchase():

9
This function is used to view purchase.

 To View stock details():

This function is used to view stock details.

 To sale the Item():

This function is used to view the selling details.

 To View Sale Details():


This function is used to view sale details of product.

 10. Menu set ():

This function is used to access all functions by entering their respective number.

 11. Run again ():

This function is used to run the program again.

10
SOFTWARE SPECIFICATION:-
Operating System : Windows 10
Platform : Python IDLE 3.9
Database : MySQL
Languages : Python
Python : Frontend

MySQL : Backend

HARDWARE SPECIFICATION:-
Device name : DESKTOP-87F5TAS

Processor : 12th Gen Intel(R) Core(TM) i5-12400 2.50 GHz

Installed RAM : 8.00 GB (7.69 GB usable)

System type : 64-bit operating system, x64-based processor

Note: For Python-MySQL connectivity, following data have been used:-


Host- localhost, user- root, password- , database- stock management

11
Source code :-
#Stock management
#This will help us to keep a track on our stocks

import os
import mysql.connector as sqltor
import datetime
now=datetime.datetime.now()

#############################################################
#In below funtion we modify the data

def product_mgmt():
while True:
print("\t\t\t 1.Add NewProduct")
print("\t\t\t 2.List Product")
print("\t\t\t 3.Update Product")
print("\t\t\t 4.Delete Product")
print("\t\t\t 5.Back(Main Menu)")
p=int(input('\t\t Enter Your Choice:'))
if p==1:
add_product()
if p==2:
search_product()
if p==3:
update_product()
if p==4:
delete_product()
if p==5:
break

###############################################################
#From here also the stocks would be modified acc. to sale

12
def purchase_mgmt():
while True:
print("\t\t\t 1.Add Order")
print("\t\t\t 2.List Order")
print("\t\t\t 3.Back(Main Menu)")
o = int(input("\t\t Enter Your Choice :"))
if o==1:
add_order()
if o==2:
list_order()
if o==3:
break

#############################################################
#This will keep a track of items available

def sales_mgmt():
while True:
print("\t\t\t 1. Sale Items")
print("\t\t\t 2. List Sales")
print("\t\t\t 3. Back (Main Menu)")
s = int (input("\t\t Enter Your Choice :"))
if s == 1:
sale_product()
if s == 2:
list_sale()
if s == 3:
break

#############################################################
#This will keep details of the employee

def user_mgmt():
while True:
print("\t\t\t 1. Add user")
print("\t\t\t 2. List user")

13
print("\t\t\t 3. Back (Main Menu)")
u = int(input("\t\t Enter Your Choice :"))
if u == 1:
add_user()
if u == 2:
list_user()
if u == 3:
break

#############################################################
#This is a backend process where tables are created

def create_table():
mydb = sqltor.connect(host="localhost", user="root",\
password="", database="stockmanagement")
mycursor = mydb.cursor()
print("Creating PRODUCT table")
sql = ("CREATE TABLE if not exists product(pcode int(4),\
pname char(30) NOT NULL,pprice float(8,2),pqty int(4),\
pcat char(30));")
mycursor.execute(sql)
print("PRODUCT table created")
print("Creating ORDERS table")
sql =("CREATE TABLE if not exists orders(orderid int(4),\
orderdate DATE,pcode char(30) NOT NULL,pprice float(8,2),\
pqty int(4),supplier char(50),pcat char(30));")
mycursor.execute(sql)
print("ORDERS table created")
print("Creating SALES table")
sql =("CREATE TABLE if not exists sales(salesid int(4),\
salesdate DATE,pcode char(30) references product(pcode),\
pprice float(8,2),pqty int(4),Total double(8,2));")
mycursor.execute(sql)
print("SALES table created")
print("creating USER table")
sql =("CREATE TABLE if not exists user(uid char(30),\
uname char(30) NOT NULL,upwd char(30));")
mycursor.execute(sql)

14
print("USER table created")

#############################################################
#With the help of this we will be able to see the tables created

def list_tables():
mydb = sqltor.connect(host="localhost", user="root", \
password="",database="stockmanagement")
mycursor = mydb.cursor()
sql = "show tables;"
mycursor.execute(sql)
for i in mycursor:
print(i)

#############################################################
#This will keep information of the product and the name of supplier

def add_order():
mydb = sqltor.connect(host="localhost", user="root", \
password="", database="stockmanagement")
mycursor = mydb.cursor()
now = datetime.datetime.now()
sql =("INSERT INTO orders(orderid, orderdate, pcode,pprice,\
pqty, supplier, pcat) values(%s,%s,%s,%s,%s,%s,%s)")
code = int(input("Enter product code :"))
oid = now.year+now.month+now.day+now.hour+now.minute+now.second
qty = int(input("Enter product quantity : "))
price = float(input("Enter Product unit price: "))
cat = input("Enter product category: ")
supplier = input("Enter Supplier details: ")
val = (oid, now, code, price, qty, supplier, cat)
mycursor.execute(sql, val)
mydb.commit()

#############################################################
#This function will list the order which is given

def list_order():

15
mydb=sqltor.connect(host="localhost", user="root", \
password="", database="stockmanagement")
mycursor = mydb.cursor()
sql=("SELECT * from orders")
mycursor.execute(sql)
print("\t\t\t\t\t\t\t ORDERS DETAILS")
print("-"*95)
print("orderid\t date \t\t pdt_code \t price \t quantity \t supplier \t\t category")
print("-" * 95)
for i in mycursor:
print(i[0], "\t", i[1], "\t", i[2], "\t\t", \
i[3], "\t", i[4], "\t\t", i[5], "\t", i[6])
print("-" * 95)

#############################################################

def db_mgmt( ):
while True:
print("\t\t\t 1. Table creation")
print("\t\t\t 2. List Tables")
print("\t\t\t 3. Back (Main Menu)")
p = int(input("\t\t Enter Your Choice :"))
if p == 1:
create_table()
if p == 2:
list_tables()
if p == 3:
break

#############################################################
#Product details are inserted with the help of function

def add_product():
mydb = sqltor.connect(host="localhost", user="root",\
password="",database="stockmanagement")
mycursor = mydb.cursor()
sql =("INSERT INTO product(pcode,pname,pprice,pqty,pcat) \

16
values (%s,%s,%s,%s,%s)")
code = int(input("\t\t Enter product code :"))
search =("SELECT count(*) FROM product WHERE pcode=%s;")
val = (code,)
mycursor.execute(search,val)
for x in mycursor:
cnt = x[0]
if cnt == 0:
name = input("\t\t Enter product name :")
qty = int(input("\t\t Enter product quantity :"))
price = float(input("\t\t Enter product unit price :"))
cat = input("\t\t Enter Product category :")
val = (code,name,price,qty,cat)
mycursor.execute(sql,val)
mydb.commit()
else:
print("\t\t Product already exist")

#############################################################
#Help us to update the quantity of exisiting product

def update_product():
mydb = sqltor.connect(host="localhost", user="root",password="", database="stockmanagement")
mycursor = mydb.cursor()
code = int(input("Enter the product code :"))
qty = int(input("Enter the quantity :"))
sql =("UPDATE product SET pqty=pqty+%s WHERE pcode=%s;")
val = (qty,code)
mycursor.execute(sql,val)
mydb.commit()
print("\t\t Product details updated")

#############################################################
#With this function we will delete the product from the table

def delete_product():
mydb = sqltor.connect(host="localhost", user="root",password="", database="stockmanagement")

17
mycursor=mydb.cursor()
code = int(input("Enter the product code :"))
sql = "DELETE FROM product WHERE pcode = %s;"
val = (code,)
mycursor.execute(sql, val)
mydb.commit()
print(mycursor.rowcount,"record(s) deleted")

#############################################################
#This will search the product as you want it to be displayed

def search_product():
while True:
print("\t\t\t 1. List all product")
print("\t\t\t 2. List product code wise")
print("\t\t\t 3. List product category wise")
print("\t\t\t 4. Back (Main Menu)")
s = int(input("\t\t Enter Your Choice :"))
if s == 1:
list_product()
if s == 2:
code=int(input(" Enter product code :"))
list_prcode(code)
if s == 3:
cat=input("Enter category :")
list_prcat(cat)
if s == 4:
break

#############################################################

def list_product():
mydb = sqltor.connect(host="localhost", user="root",password="",database="stockmanagement")
mycursor = mydb.cursor()
sql =("SELECT * from product")
mycursor.execute(sql)
print("\t\t\t\t PRODUCT DETAILS")

18
print("\t\t", "-" * 60)
print("\t\t code \t name \t price \t quantity \t category")
print("\t\t", "-" * 60)
for i in mycursor:
print("\t\t", i[0], "\t", i[1], "\t", i[2], "\t", i[3],
"\t\t", i[4])
print("\t\t", "-" * 60)

#############################################################

def list_prcode(code):
mydb = sqltor.connect(host="localhost", user="root",password="", database="stockmanagement")
mycursor = mydb.cursor()
sql = ("SELECT * from product WHERE pcode=%s")
val = (code,)
mycursor.execute(sql, val)
print("\t\t\t\t PRODUCT DETAILS")
print("\t\t", "-" * 60)
print("\t\t code \t name \t price \t quantity \t category")
print("\t\t", "-" * 60)
for i in mycursor:
print("\t\t", i[0], "\t", i[1], "\t", i[2], "\t", i[3],
"\t\t", i[4])
print("\t\t", "-" * 60)

############################################################

def sale_product():
mydb = sqltor.connect(host="localhost", user="root",password="", database="stockmanagement")
mycursor = mydb.cursor()
pcode = input("Enter product code: ")
sql = "SELECT count(*) from product WHERE pcode=%s;"
val = (pcode,)
mycursor.execute(sql,val)
for x in mycursor:
cnt = x[0]
if cnt != 0 :

19
sql = "SELECT * from product WHERE pcode=%s;"
val = (pcode,)
mycursor.execute(sql, val)
for x in mycursor:
print(x)
price = int(x[2])
pqty = int(x[3])
qty = int(input("Enter no of quantity :"))
if qty <= pqty:
total = qty * price
print("Collect Rs. ", total)
sql =("INSERT into sales values(%s,%s,%s,%s,%s,%s)")
val = (int(cnt),datetime.datetime.now(),pcode,
price,qty,total)
mycursor.execute(sql,val)
sql = "UPDATE product SET pqty=pqty-%s WHERE pcode=%s"
val = (qty, pcode)
mycursor.execute(sql, val)
mydb.commit()
else:
print("Quantity not available")
else:
print("Product is not available")

#############################################################

def list_sale():
mydb = sqltor.connect(host="localhost", user="root",
password="", database="stockmanagement")
mycursor = mydb.cursor()
sql = "SELECT * FROM sales"
mycursor.execute(sql)
print("\t\t\t\t SALES DETAILS")
print("-" * 90)
print("Sales_ID \t Date \t\t Prd_Code \tPrice \t\t\
Quantity \t Total")
print("-" * 90)
for x in mycursor:

20
print(x[0], "\t\t", x[1], "\t", x[2], "\t\t", x[3],
"\t\t", x[4], "\t\t", x[5])
print("-" * 90)

#############################################################

def list_prcat(cat):
mydb = sqltor.connect(host="localhost", user="root",
password="", database="stockmanagement")
mycursor = mydb.cursor()
print(cat)
sql="SELECT * from product WHERE pcat =%s"
val = (cat,)
mycursor.execute(sql, val)
clrscr()
print("\t\t\t\t PRODUCT DETAILS")
print("\t\t", "-" * 60)
print("\t\t code \t name \t price \t quantity \t category")
print("\t\t", "-" * 60)
for i in mycursor:
print("\t\t", i[0], "\t", i[1], "\t", i[2], "\t", i[3],
"\t\t", i[4])
print("\t\t", "-" * 60)

#############################################################

def add_user():
mydb = sqltor.connect(host="localhost", user="root",
password="", database="stockmanagement")
mycursor = mydb.cursor()
uid = input("Enter emaid id :")
name = input("Enter Name :")
password = input("Enter Password :")
sql = ("INSERT INTO user values (%s,%s,%s);")
val = (uid, name, password)
mycursor.execute(sql, val)
mydb.commit()

21
print(mycursor.rowcount, "user created")

#############################################################

def list_user():
mydb = sqltor.connect(host="localhost", user="root",
password="", database="stockmanagement")
mycursor = mydb.cursor()
sql = "SELECT uid, uname from user"
mycursor.execute(sql)
clrscr()
print("\t\t\t\t USER DETAILS")
print("\t\t", "-" * 40)
print("\t\t UID \t\t\t\t Name ")
print("\t\t", "-" * 40)
for i in mycursor:
print("\t\t", i[0], "\t", i[1])
print("\t\t", "-" * 40)

#############################################################

def clrscr():
print("\n"*5)
while True:
clrscr()
print("\t\t\t STOCK MANAGEMENT")
print("\t\t\t *****************\n")
print("\t\t 1. DATABASE SETUP")
print("\t\t 2. PRODUCT MANAGEMENT")
print("\t\t 3. PURCHASE MANAGEMENT")
print("\t\t 4. SALES MANAGEMENT")
print("\t\t 5. USER MANAGEMENT")
print("\t\t 6. EXIT\n")
n = int(input("Enter your choice :"))
if n == 1:
db_mgmt()
if n == 2:

22
product_mgmt()
if n == 3:
os.system('cls')
purchase_mgmt()
if n == 4:
sales_mgmt()
if n == 5:
user_mgmt()
if n == 6:
break

#Program Over!!!
#The above program can be used in grocery shop

23
Output:-

1:-idle output

Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit

(AMD64)] on win32

Type "help", "copyright", "credits" or "license()" for more information.

=RESTART:C:\Users\ACER\Desktop\stock_management-20241220T041304Z001\

stock_management\stockmanagement.py

24
STOCK MANAGEMENT

*****************

1. DATABASE SETUP

2. PRODUCT MANAGEMENT

3. PURCHASE MANAGEMENT

4. SALES MANAGEMENT

5. USER MANAGEMENT

6. EXIT

25
Enter your choice :1

1. Table creation

2. List Tables

3. Back (Main Menu)

Enter Your Choice :1

Creating PRODUCT table

PRODUCT table created

Creating ORDERS table

ORDERS table created

Creating SALES table

26
SALES table created

creating USER table

USER table created

1. Table creation

2. List Tables

3. Back (Main Menu)

Enter Your Choice :2

('orders',)

('product',)

('sales',)

27
('user',)

1. Table creation

2. List Tables

3. Back (Main Menu)

Enter Your Choice :3

STOCK MANAGEMENT

*****************

1. DATABASE SETUP

2. PRODUCT MANAGEMENT

28
3. PURCHASE MANAGEMENT

4. SALES MANAGEMENT

5. USER MANAGEMENT

6. EXIT

Enter your choice :2

1.Add NewProduct

2.List Product

3.Update Product

4.Delete Product

29
5.Back(Main Menu)

Enter Your Choice:1

Enter product code :001

Enter product name :tea

Enter product quantity :100

Enter product unit price :25

Enter Product category :food

1.Add NewProduct

2.List Product

3.Update Product

30
4.Delete Product

5.Back(Main Menu)

Enter Your Choice:002

1. List all product

2. List product code wise

3. List product category wise

4. Back (Main Menu)

Enter Your Choice :4

1.Add NewProduct

2.List Product

31
3.Update Product

4.Delete Product

5.Back(Main Menu)

Enter Your Choice:1

Enter product code :002

Enter product name :Coffe

Enter product quantity :30

Enter product unit price :45

Enter Product category :food

1.Add NewProduct

32
2.List Product

3.Update Product

4.Delete Product

5.Back(Main Menu)

Enter Your Choice:2

1. List all product

2. List product code wise

3. List product category wise

4. Back (Main Menu)

Enter Your Choice :1

33
PRODUCT DETAILS

------------------------------------------------------------

code name price quantity category

------------------------------------------------------------

34 saree 45.0 145 dress

1 tea 25.0 100 food

2 Coffe 45.0 30 food

------------------------------------------------------------

1. List all product

2. List product code wise

34
3. List product category wise

4. Back (Main Menu)

Enter Your Choice :2

Enter product code :002

PRODUCT DETAILS

------------------------------------------------------------

code name price quantity category

------------------------------------------------------------

2 Coffe 45.0 30 food

------------------------------------------------------------

35
1. List all product

2. List product code wise

3. List product category wise

4. Back (Main Menu)

Enter Your Choice :2

Enter product code :005

PRODUCT DETAILS

------------------------------------------------------------

code name price quantity category

------------------------------------------------------------

36
5 Olive Oil 100.0 60 Food

------------------------------------------------------------

1. List all product

2. List product code wise

3. List product category wise

4. Back (Main Menu)

Enter Your Choice :1

PRODUCT DETAILS

------------------------------------------------------------

code name price quantity category

37
------------------------------------------------------------

34 saree 45.0 145 dress

1 tea 25.0 100 food

2 Coffe 45.0 30 food

3 Rice 40.0 150 Food

4 Pasta 20.0 80 Food

5 Olive Oil 100.0 60 Food

------------------------------------------------------------

1. List all product

2. List product code wise

38
3. List product category wise

4. Back (Main Menu)

Enter Your Choice :4

1.Add NewProduct

2.List Product

3.Update Product

4.Delete Product

5.Back(Main Menu)

Enter Your Choice:4

Enter the product code :005

39
1 record(s) deleted

1.Add NewProduct

2.List Product

3.Update Product

4.Delete Product

5.Back(Main Menu)

Enter Your Choice:2

1. List all product

2. List product code wise

3. List product category wise

40
4. Back (Main Menu)

Enter Your Choice :1

PRODUCT DETAILS

------------------------------------------------------------

code name price quantity category

------------------------------------------------------------

34 saree 45.0 145 dress

1 tea 25.0 100 food

2 Coffe 45.0 30 food

3 Rice 40.0 150 Food

41
4 Pasta 20.0 80 Food

------------------------------------------------------------

1. List all product

2. List product code wise

3. List product category wise

4. Back (Main Menu)

Enter Your Choice :4

1.Add NewProduct

2.List Product

3.Update Product

42
4.Delete Product

5.Back(Main Menu)

Enter Your Choice:5

STOCK MANAGEMENT

*****************

1. DATABASE SETUP

2. PRODUCT MANAGEMENT

3. PURCHASE MANAGEMENT

43
4. SALES MANAGEMENT

5. USER MANAGEMENT

6. EXIT

Enter your choice :3

1.Add Order

2.List Order

3.Back(Main Menu)

Enter Your Choice :1

Enter product code :006

44
Enter product quantity : 2

Enter Product unit price: 56

Enter product category: food

Enter Supplier details: adfco

1.Add Order

2.List Order

3.Back(Main Menu)

Enter Your Choice :2

ORDERS DETAILS

45
----------------------------------------------------------------------------------

-------------

orderid date pdt_code price quantity supplier category

----------------------------------------------------------------------------------

-------------

2116 2024-12-20 6 56.0 2 adfco food

1 2023-10-01 001 30.0 50 Supplier A Food

2 2023-10-02 002 10.0 200 Supplier B Food

3 2023-10-03 003 40.0 150 Supplier C Food

4 2023-10-04 004 20.0 80 Supplier D Food

46
5 2023-10-05 005 100.0 60 Supplier E Food

----------------------------------------------------------------------------------

--------

1.Add Order

2.List Order

3.Back(Main Menu)

Enter Your Choice :3

STOCK MANAGEMENT

*****************

1. DATABASE SETUP

47
2. PRODUCT MANAGEMENT

3. PURCHASE MANAGEMENT

4. SALES MANAGEMENT

5. USER MANAGEMENT

6. EXIT

Enter your choice :4

1. Sale Items

2. List Sales

3. Back (Main Menu)

Enter Your Choice :2

48
SALES DETAILS

----------------------------------------------------------------------------------

--------

Sales_ID Date Prd_Code Price Quantity Total

----------------------------------------------------------------------------------

--------

1 2023-10-01 001 30.0 2 60.0

2 2023-10-02 002 10.0 5 50.0

3 2023-10-03 003 40.0 3 120.0

4 2023-10-04 004 20.0 4 80.0

49
5 2023-10-05 005 100.0 1 100.0

----------------------------------------------------------------------------------

--------

1. Sale Items

2. List Sales

3. Back (Main Menu)

Enter Your Choice :3

STOCK MANAGEMENT

*****************

1. DATABASE SETUP

50
2. PRODUCT MANAGEMENT

3. PURCHASE MANAGEMENT

4. SALES MANAGEMENT

5. USER MANAGEMENT

6. EXIT

Enter your choice :5

1. Add user

2. List user

3. Back (Main Menu)

Enter Your Choice :1

51
Enter emaid id :006

Enter Name :abc

Enter Password :dfg

1 user created

1. Add user

2. List user

3. Back (Main Menu)

Enter Your Choice :2

USER DETAILS

----------------------------------------

52
UID Name

----------------------------------------

user001 Alice

user002 Bob

user003 Charlie

user004 Diana

user005 Eve

006 abc

----------------------------------------

1. Add user

53
2. List user

3. Back (Main Menu)

Enter Your Choice :3

STOCK MANAGEMENT

****************

1. DATABASE SETUP

2. PRODUCT MANAGEMENT

3. PURCHASE MANAGEMENT

4. SALES MANAGEMENT

5. USER MANAGEMENT

54
6. EXIT

Enter your choice :6

2.sql output:-
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 40
Server version: 5.5.16-log MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its


affiliates. Other names may be trademarks of their respective
owners.

55
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use stockmanagement;


Database changed
mysql> show tables;
+---------------------------+
| Tables_in_stockmanagement |
+---------------------------+
| orders |
| product |
| sales |
| user |
+---------------------------+
4 rows in set (0.00 sec)

mysql> select*orders;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'orders' at line 1
mysql> SELECT * FROM orders;
+---------+------------+-------+--------+------+------------+------+

56
| orderid | orderdate | pcode | pprice | pqty | supplier | pcat |
+---------+------------+-------+--------+------+------------+------+
| 2116 | 2024-12-20 | 6 | 56.00 | 2 | adfco | food |
| 1 | 2023-10-01 | 001 | 30.00 | 50 | Supplier A | Food |
| 2 | 2023-10-02 | 002 | 10.00 | 200 | Supplier B | Food |
| 3 | 2023-10-03 | 003 | 40.00 | 150 | Supplier C | Food |
| 4 | 2023-10-04 | 004 | 20.00 | 80 | Supplier D | Food |
| 5 | 2023-10-05 | 005 | 100.00 | 60 | Supplier E | Food |
+---------+------------+-------+--------+------+------------+------+
6 rows in set (0.00 sec)

mysql> SELECT * FROM product;


+-------+-------+--------+------+-------+
| pcode | pname | pprice | pqty | pcat |
+-------+-------+--------+------+-------+
| 34 | saree | 45.00 | 145 | dress |
| 1 | tea | 25.00 | 100 | food |
| 2 | Coffe | 45.00 | 30 | food |
| 3 | Rice | 40.00 | 150 | Food |

57
| 4 | Pasta | 20.00 | 80 | Food |
+-------+-------+--------+------+-------+
5 rows in set (0.00 sec)

mysql> SELECT * FROM user;


+---------+---------+-------------+
| uid | uname | upwd |
+---------+---------+-------------+
| user001 | Alice | password123 |
| user002 | Bob | securepass |
| user003 | Charlie | mypassword |
| user004 | Diana | dianapass |
| user005 | Eve | evepassword |
| 006 | abc | dfg |
+---------+---------+-------------+
6 rows in set (0.01 sec)

mysql>

58
BIBLIOGRAPHY:-
 python.org
 Code Academy

 tutorialsPoint.com

 PythonChallenge.com

 Google’s Python Class

 LearnPython.org

 layak.in

59
60

You might also like