Cs Project
Cs Project
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 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.
D
Page:4
Teacher: Mr. Deepak Kumar
Create a database
Create a table
Addition of data
Modification
Display
Deletion
Search
D
Page:5
Teacher: Mr. Deepak Kumar
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
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
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