0% found this document useful (0 votes)
13 views19 pages

Cs Project

Uploaded by

user-988425
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)
13 views19 pages

Cs Project

Uploaded by

user-988425
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/ 19

Teacher: Mr.

Deepak Kumar

Name:
Class:
Board Roll no:
2024-2025

D
Page:1
Teacher: Mr. Deepak Kumar

INDEX
S.No Topic Page No.
1 Index 1
2 Certificate 2
3 Acknowledgement 3
4 Introduction 4
5 Hardware Used 5
6 Software Used 5
7 Limitations 6
8 Advantages 6
9 Scope for improvement 6
10 Source code 7 to 13
11 Output 14 to 17
12 Bibliography 18

D
Page:2
Teacher: Mr. Deepak Kumar

CERTIFICATE
This is to certify that ……..........................., a student ofclass
XII Science has successfully completed the research project
on the topic “Biology-Lab stock Management” under the
guidance of Mr. Deepak Kumar
This project is absolutely genuine and does not indulge in
plagiarism of any kind.
The references taken in making this project have been
declared at the end of this report.

Signature Signature
(Internal Examinerr) (External Examiner)

D
Page:3
Teacher: Mr. Deepak Kumar

I am extremely grateful to Mr. Deepak Kumar, Teacher of


Department of Computer Science/IP for his able guidance and
useful suggestions, which helped me in completing the project
work, in time.

I would also like to thank all the teaching and non-teaching staff
of Computer Science department /IP who helped me directly or
indirectly in the completion of this project.

Finally, yet importantly, I would like to express my heartfelt


thanks to my beloved parents for their blessings, my
friends/classmates for their help and wishes for the successful
completion of this project. Moreover, I would also like to thank
CBSE for giving me this opportunity to undertake this project.

Name of Candidate: ……………………………

Class 12 Science, Roll No. ……………………..

D
Page:4
Teacher: Mr. Deepak Kumar

This project entitled to BIOLOGY-LAB STOCK


MANAGEMENT is a NON-GUI based client server
application that is used for standard operations. This
project uses Python platform as the front end and MySQL
is the back end DBMS.
It can be used for the following operation like:

 Create a database
 Create a table
 Addition of data
 Modification
 Display
 Deletion
 Search

D
Page:5
Teacher: Mr. Deepak Kumar

 Computer with minimum specification. ( i3 10th Gen


intel processor,4 GB RAM,500 GB internal storage)
 Printer
 CD
 USB Pen Drive

 MS Office
 Python
 MySQL

D
Page:6
Teacher: Mr. Deepak Kumar

def menu():
c=1
while c==1:
print("BIO LAB STOCK MANAGEMENT")
print("1.To Create Database biology")
print("2.To Create Table materials")
print("3.To Add Items")
print("4.To Update Items")
print("5.To Search Items")
print("6.To Delete Items")
print("7.To Display All Items")
print("8.To Display category wise")
print("9.Exit")
choice=int(input("Enter your Choice:"))
if choice==1:
createdatabase()
elif choice==2:
createtable()
elif choice==3:
addrecord()
elif choice==4:
updaterecord()
elif choice==5:
D
Page:8
Teacher: Mr. Deepak Kumar

searchrecord()
elif choice==6:
deleterecord()
elif choice==7:
displayall()
elif choice==8:
displaycategorywise()
elif choice==9:
print("Application closed")
break
c=int(input("Enter 1 to continue. ... "))

def createdatabase():
import mysql.connector
mydb=mysql.connector.connect(host="localhost",us
er="root",passwd="MYSQL")
mycursor=mydb.cursor()
mycursor.execute("create database biology")
def createtable():
import mysql.connector
import mysql.connector
mydb=mysql.connector.connect(host="localhost",
user="root",
passwd="MYSQL",
database='biology')
mycursor=mydb.cursor()

D
Page:9
Teacher: Mr. Deepak Kumar

mycursor.execute("create table materials ( ITEMID


varchar(30) primary key,ITEMNAME
varchar(30),type varchar(30),DOM date,DOE
date,PRICE double(10,2),quantity int(6));")

def addrecord():
import mysql.connector
import mysql.connector
mydb=mysql.connector.connect(host="localhost",us
er="root",
passwd="MYSQL",database='biology')
mycursor=mydb.cursor()
a=input("1.Enter Item Id:")
b=input("2.Enter Item Name:")
c=input("3.Enter Type
(Chemical,apparatus,specimen,miscellaneous:)")
d=input("4.Enter Date of Manufacture:")
e=input("5.Enter Date of Expiry:")
f=int(input("6.Enter Price per unit:"))
g=int(input("8.Enter quantity:"))
query=("insert into materials
values(%s,%s,%s,%s,%s,%s,%s)")
data=(a,b,c,d,e,f,g)
mycursor.execute(query,data)
mydb.commit()
mydb.close()

D
Page:10
Teacher: Mr. Deepak Kumar

def displayall():
import mysql.connector
mydb=mysql.connector.connect(host="localhost",us
er="root",
passwd="MYSQL",database="biology")
mycursor=mydb.cursor()
query="select * from materials "
mycursor.execute(query)
print(" ")
record=mycursor.fetchall()

for i in record:
print(i)
mydb.close()

def updaterecord():
import mysql.connector
mydb=mysql.connector.connect(host="localhost",us
er="root",
passwd="MYSQL",database='biology')
mycursor=mydb.cursor()
a=input("1.Enter Item Id:")
b=input("2.Enter Item Name:")
c=input("3.Enter Type
(Chemical,apparatus,specimen,miscellaneous:)")

D
Page:11
Teacher: Mr. Deepak Kumar

d=input("4.Enter Date of Manufacture:")


e=input("5.Enter Date of Expiry:")
f=int(input("6.Enter Price:"))
g=int(input("7.Enter quantity:"))
query=("update materials set
itemname=%s,type=%s,dom=%s,doe=%s,price=%s
,quantity=%s where itemid=%s")
data=(b,c,d,e,f,g,a)
mycursor.execute(query,data)
mydb.commit()
mydb.close()

def searchrecord():
import mysql.connector
mydb=mysql.connector.connect(host="localhost",us
er="root",
passwd="MYSQL",database="biology")
mycursor=mydb.cursor()
id=input("Enter Item Id:")
query="select * from materials "
mycursor.execute(query)
print("=================")
record=mycursor.fetchall()
for i in record:
if id==i[0]:
print(id,"Found")

D
Page:12
Teacher: Mr. Deepak Kumar

print("=====================")
print("1.Item ID:",i[0])
print("2.Item Name:",i[1])
print("3.Type :",i[2])
print("4.Date of Manufacture:",i[3])
print("5.Date of Expiry:",i[4])
print("6.Price per unit:",i[5])
print("7. Quantity:",i[6])
print("======================")
mydb.close()

def deleterecord():
import mysql.connector
mydb=mysql.connector.connect(host="localhost",us
er="root",passwd="MYSQL",database="biology")
mycursor=mydb.cursor()
id=input("Enter a item id to be deleted")
query=("delete from materials where itemid=%s")
data=(id,)
mycursor.execute(query,data)
mydb.commit()
mydb.close()

D
Page:13
Teacher: Mr. Deepak Kumar

def displaycategorywise():
import mysql.connector
mydb=mysql.connector.connect(host="localhost",us
er="root",
passwd="MYSQL",database="biology")
mycursor=mydb.cursor()
query="select * from materials group by type"
mycursor.execute(query)
print(" ")
record=mycursor.fetchall()
for i in record:
print(i)
mydb.close()
#Driver program
menu()

D
Page:14
Teacher: Mr. Deepak Kumar

D
Page:15
Teacher: Mr. Deepak Kumar

D
Page:16
Teacher: Mr. Deepak Kumar

D
Page:17
Teacher: Mr. Deepak Kumar

D
Page:18
Teacher: Mr. Deepak Kumar

 Sumita Arora
 Preeti Arora
 www.google.com.in

D
Page:19

You might also like