Professional Documents
Culture Documents
CS Project
CS Project
On
Library Management
Submitted By
Virender Singh Rathore
Class: - XII C
CERTIFICATE
This is to certify that VIRENDER SINGH RATHORE Of
Class XII C has prepared the report on the Project
entitled “Library Management ”. The report is the
result of his efforts & endeavors. The report is found
worthy of acceptance as final project report for the
subject Computer Science of Class XII. He has
prepared the report under my guidance.
(Mr. M L Meena)
PGT (Computer Science)
Department of Computer Science
Kendriya Vidyalaya No. 2
Delhi Cantt , New Delhi
CERTIFICATE
The project report entitled“Library Management ”,
Submitted by VIRENDER SINGH RATHORE of Class XII C for
the CBSE Senior Secondary Examination class XII of Computer
Science at Kendriya Vidyalaya No. 2, Delhi Cantt has been
examined.
SIGNATURE OF EXAMINER
DECLARATION
#CREATING DATABASE
import mysql.connector
mydb=mysql.connector.connect(host="localhost",user="root",passwd=
"bsr@1970")
mycursor=mydb.cursor()
mycursor.execute("create database if not exists library")
mycursor.execute("use library")
if ch==3:
print("press 1 to update name:")
print(" ")
print("press 2 to update phone no:")
print(" ")
print("press 3 to update address:")
print(" ")
print("press 4 to update date of birth:")
print(" ")
ch1=int(input("Enter your choice:"))
if ch1==4:
mycursor.execute("select * from library_master")
for i in mycursor:
print(i)
cardno=str(input("Enter card no:"))
dob=str(input("Enter new date of birth(yyyy-mm-dd):"))
mycursor.execute("update library_master set dob='"+dob+"'
where cardno='"+cardno+"'")
mydb.commit()
print("*Date of birth has been updated*")
mycursor.execute("select * from library_master")
for i in mycursor:
print(i)
#TO DELETE AN ACCOUNT
if ch==4:
mycursor.execute("select * from library_master")
for i in mycursor:
print(i)
cardno=str(input("Enter card no:"))
mycursor.execute("delete from library_master where
cardno='"+cardno+"'")
mydb.commit()
print("*Removed succesfully*")
mycursor.execute("select * from library_master")
for i in mycursor:
print(i)
if ch==6:
book_no=str(input("Enter Book No:"))
mycursor.execute("select * from books where book_no=
'"+book_no+"'")
for i in mycursor:
print(i)
if ch1==2:
mycursor.execute("select * from books")
for i in mycursor:
print(i)
book_no=str(input("Enter card no:"))
genre=str(input("Enter new genre:"))
mycursor.execute("update books set genre='"+genre+"'
where book_no='"+book_no+"'")
mydb.commit()
print("*Genre has been updated*")
mycursor.execute("select * from books")
for i in mycursor:
print(i)
if ch1==3:
mycursor.execute("select * from books")
for i in mycursor:
print(i)
book_no=str(input("Enter book no:"))
author=str(input("Enter new authors name:"))
mycursor.execute("update books set authors_name=
'"+author+"'where book_no='"+book_no+"'")
mydb.commit()
print("*Authors name has been updated*")
mycursor.execute("select * from books")
for i in mycursor:
print(i)
#TO UPDATE LANGUAGE
if ch1==4:
mycursor.execute("select * from books")
for i in mycursor:
print(i)
book_no=str(input("Enter boom no:"))
language=str(input("Enter new language:"))
mycursor.execute("update books set language='"+language+”’
where book_no='"+book_no+"'")
mydb.commit()
print("*Language has been updated*")
mycursor.execute("select * from books")
for i in mycursor:
print(i)
if ch==8:
mycursor.execute("select * from books")
for i in mycursor:
print(i)
book_no=str(input("Enter book no:"))
mycursor.execute("delete from books where
book_no='"+book_no+"'")
mydb.commit()
print("*Removed succesfully*")
mycursor.execute("select * from books")
for i in mycursor:
print(i)
if ch==10:
print("if you wanna go back press 1")
print(" ")
print("if you wanna coontinue press 2")
print(" ")
a=int(input("enter your choice:"))
if (a==1):
continue
if a==2:
cardno=str(input("Enter card no:"))
date_of_return=str(input("Enter date of returning(yyyy-mm-dd):"))
mycursor.execute("update library_transaction set date_of_return=
'"+date_of_return+"' where cardno='"+cardno+"'")
mydb.commit()
if ch==11:
cardno=str(input("Enter card no:"))
mycursor.execute("select * from library_transaction where
cardno='"+cardno+"'")
data=cursor.fetchall()
for i in data:
print(i)
if ch==12:
orderno=str(input("Enter the order no:"))
name_of_book=str(input("Enter the name of the book:"))
del_date=str(input("enter the expected delivery date of books(yyyy-
mm-dd):"))
price=str(input("Enter the price of the book"))
mycursor.execute("insert into buy_new_books values
('"+orderno+"','"+name_of_book+"','"+del_date+"','"+price+"')")
mydb.commit()
if ch==13:
print("press 1 to update name of book")
print(" ")
print("press 2 to update delivery date")
print(" ")
print("press 3 to update price")
print(" ")
ch1=int(input("Enter your choice:"))
#TO UPDATE BOOK NAME
if ch1==1:
mycursor.execute("select * from buy_new_books")
for i in mycursor:
print(i)
orderno=str(input("Enter order no:"))
name_of_book=str(input("Enter new name:"))
mycursor.execute("update buy_new_books set name_of_book=
'"+name_of_book+"' where orderno='"+orderno+"'")
mydb.commit()
print("*Name has been updated*")
mycursor.execute("select * from buy_new_books")
for i in mycursor:
print(i)
if ch1==2:
mycursor.execute("select * from buy_new_books")
for i in mycursor:
print(i)
orderno=str(input("Enter card no:"))
del_date=str(input("Enter new delivery date(yyyy-mm-dd):"))
mycursor.execute("update buy_new_books set del_date=
'"+del_date+"' where orderno='"+orderno+"'")
mydb.commit()
print("*Delivery date has been updated*")
mycursor.execute("select * from buy_new_books")
for i in mycursor:
print(i)
if ch1==3:
mycursor.execute("select * from buy_new_books")
for i in mycursor:
print(i)
orderno=str(input("Enter card no:"))
price=str(input("Enter new price:"))
mycursor.execute("update buy_new_books set price='"+price+"'
where orderno='"+orderno+"'")
mydb.commit()
print("*Price has been updated*")
mycursor.execute("select * from buy_new_books")
for i in mycursor:
print(i)
else:
break
OUTPUT SCREENS
BIBLIOGRAPHY
1.http://www.google.com/
2.http://en.wikipedia.org
3.Computer Science with Python by Sumita
Arora
4.www.bOtskOOL.com