0% found this document useful (0 votes)
8 views

bhupesh ip project

Uploaded by

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

bhupesh ip project

Uploaded by

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

INFORMATICS

PRACTICES
PROJECT WORK
TOPIC :- Library record
keeping
SUBMITTED BY : Bhupesh Kumar
Yadav

SUBMITTED TO : MR. O. P. MEENA


SIR
Acknowledgement

I would like to express my heartfelt gratitude to


my information practices teacher Mr. O.P
Meena as well as our principal Mr. L.R Saini for
guiding and helping me throughout the project.
I would also like to thank my parents and other
family members for encouraging me for the
same.
I would also like to thank my class mates for
appreciating my efforts and ideas.
At the end I would like to thank all those whom I
have left behind by mistake.
CERTIFICAT
E
This is to certify that the Project title

Library Record keeping submitted by Bhupesh


kumar Yadav Library of Class XII-D session (2024-25)
was carried out by him at PM SHRI KENDRIYA

VIDYALAYA where project work has been done under


the supervision of MR. O. P. MEENA and
secures__________ Marks/Grade in it.

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

LIBRARY’S SIGNATURE TEACHER’S


SIGNATURE

(Bhupesh ) (Mr. O. P MEENA)


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

EXTERNAL’S SIGNATURE

LIBRARY RECORD
KEEPING CODE
print("__________Library Management System__________")

#creating database
import mysql.connector

mydb=mysql.connector.connect(host="localhost",user="root",passwd="how
areyou",charset="utf8")

mycursor=mydb.cursor()

mycursor.execute("create database if not exists Library")

mycursor.execute("use Library")

#creating required tables


mycursor.execute("create table if not exists register(book_name char(30)
primary key,author_name varchar(30),bookcode int,price float)")

mydb.commit()

while(True):

print("1=Add Library record")

print("2=delete Library record")


print("3=update Library record")

print("4=search Library record")

print("5=Exit")

choice=int(input("Enter your choice:"))

if(choice==1):

print("All information prompted are mandatory to be filled")

book_name=input("Enter Book name :")

author_name=input("Enter author name :")

bookcode =input("Enter special book code labeled on it :")

price=input("Enter price:")

mycursor.execute("insert into register


values('"+Book_name+"','"+author_name+"','"+bookcode+"','"+price+"');")

mydb.commit()

print("record is successfully added!!!")

elif(choice==2):

bookcode=input("Enter book code")

mycursor.execute("delete from register where


bookcode='"+bookcode+"';")

mydb.commit()

print("record is deleted successfully!!!")

elif(choice==3):
bookcode=input("Enter book code")

price=input("Enter new price to be updated: ")

mycursor.execute("update register set price='"+price+"' where


bookcode='"+bookcode+"';")

mydb.commit()

print("record is successfully updated!!!")

elif(choice==4):

book_name=input("Enter book_name ")

mycursor.execute("select * from register where


book_name='"+book_name+"'"+";")

for i in mycursor:

print(i)

else:

break
Outputs of Above Code
Result of Above Additon
Choice 2: Delete a Record

Result table

Choice
3: Update a Record

Result table
Choice 4: Search a Record

Result table
THANK
YOU

You might also like