COMPUTER SCIENCE
PROJECT TITLE : LIBRARY MANAGEMENT SYSTEM
SUBMITTED BY : [Link]
ROLL NO : ___________________________________________
ALL INDIA SENIOR SECONDARY
CERTIFICATE EXAMINATION
(AISSCE)
BONOFIDE CERTIFICATE
This is to certify that the project entitles LIBRARY
MANAGEMENT SYSTEM is a bonafide work done by [Link] of
Class XII Computer Science, Session 2025-26 in the partial
fulfilment of CBSE AISSCE Examination and has been carried out
under my direct supervision and guidance.
Internal Examinar External Examinar
Principal
ACKNOWLEDGEMENT
I would like to express my special thanks of gratitude to my
teacher Mrs. Shanmuga Priya J as well as our Principal
Mr. Murugadasan P, who gave me the golden opportunity to do
this wonderful project on the topic LIBRARY MANAGEMENT
SYSTEM which also helped me in doing a lot of research and I
came to know about so many new things. I am really thankful to
them. I would also like to thank my parents and friends who
helped me a lot in finalizing this project within the limited time
frame. Last but not least, I would like to thank all those who had
helped towards the completion of this project.
SOURCE CODE
print("""****************************
* *
**** LIBRARY CODES ****
* *
****************************""")
#CREATING DATABASE
import [Link]
mydb=[Link](host="localhost",user="root",passwd="9838702146")
mycursor=[Link]()
[Link]("create database if not exists library")
[Link]("use library")
#CREATING REQUIRED TABLES
[Link]("create table if not exists library_master(cardno char(10) primary
key,name_of_person varchar(30),phone_no char(10),address varchar(30),dob date)")
[Link]("create table if not exists books(book_name varchar(50),book_no char(5)
primary key,genre varchar(40),authors_name varchar(40),language varchar(15))")
[Link]("create table if not exists library_transaction(cardno char(10),foreign
key(cardno) references library_master(cardno),book_name varchar(40),date_of_lend
date,date_of_return date)")
[Link]("create table if not exists buy_new_books(orderno varchar(6) primary
key,name_of_book varchar(20),del_date date,price char(4))")
[Link]()
while True:
print("1=create a new account")
print("2=see the account info")
print("3=update card holder info")
print("4=delete the account")
print("5=add new book")
print("6=see books")
print("7=update book details")
print("8=delete book")
print("9=lend a book")
print("10=return the book")
print("11=display lending history")
print("12=order a new book")
print("13=update order details")
print("14=display ordering history")
print("15=EXIT")
cho='y'
while cho=='y':
ch=int(input("enter your choice"))
#TO CREATE A LIBRARY ACCOUNT
if ch==1:
print("if you wanna go back press 1")
print(" ")
print("if you wanna continue press 2")
print(" ")
a=int(input("enter your choice:"))
if a==1:
continue
if a==2:
print("FILL ALL PERSONAL DETAILS OF ACCOUNT HOLDER")
cardno=str(input("enter card no:"))
name_of_person=str(input("Enter name (limit 30 characters):"))
phone_no=str(input("Enter phone no:"))
address=str(input("Enter the address (max 30 words):"))
dob=str(input("Enter the date of birth(yyyy-mm-dd):"))
[Link]("insert into library_master
values('"+cardno+"','"+name_of_person+"','"+phone_no+"','"+address+"','"+dob+"')")
[Link]()
print("ACCOUNT IS SUCCESSFULLY CREATED!!!")
#TO SEE DETAILS OF CARD HOLDER
if ch==2:
cardno=str(input("Enter card no:"))
[Link]("select * from library_master where cardno='"+cardno+"'")
for i in mycursor:
print(i)
#TO UPDATE CARD HOLDER INFORMATION
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:"))
#TO UPDATE NAME
if ch1==1:
[Link]("select * from library_master")
for i in mycursor:
print(i)
cardno=str(input("Enter card no:"))
name_of_person=str(input("Enter new name:"))
[Link]("update library_master set name_of_person='"+name_of_person+"'
where cardno='"+cardno+"'")
[Link]()
print("*Name has been updated*")
[Link]("select * from library_master")
for i in mycursor:
print(i)
#TO UPDATE PHONE NUMBER
if ch1==2:
[Link]("select * from library_master")
for i in mycursor:
print(i)
cardno=str(input("Enter card no:"))
phone_no=str(input("Enter new phone no:"))
[Link]("update library_master set phone_no='"+phone_no+"' where
cardno='"+cardno+"'")
[Link]()
print("*Number has been updated*")
[Link]("select * from library_master")
for i in mycursor:
print(i)
#TO UPDATE ADDRESS
if ch1==3:
[Link]("select * from library_master")
for i in mycursor:
print(i)
cardno=str(input("Enter card no:"))
address=str(input("Enter new address:"))
[Link]("update library_master set address='"+address+"' where
cardno='"+cardno+"'")
[Link]()
print("*Address has been updated*")
[Link]("select * from library_master")
for i in mycursor:
print(i)
#TO UPDATE DATE OF BIRTH
if ch1==4:
[Link]("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):"))
[Link]("update library_master set dob='"+dob+"' where
cardno='"+cardno+"'")
[Link]()
print("*Date of birth has been updated*")
[Link]("select * from library_master")
for i in mycursor:
print(i)
#TO DELETE AN ACCOUNT
if ch==4:
[Link]("select * from library_master")
for i in mycursor:
print(i)
cardno=str(input("Enter card no:"))
[Link]("delete from library_master where cardno='"+cardno+"'")
[Link]()
print("*Removed succesfully*")
[Link]("select * from library_master")
for i in mycursor:
print(i)
#TO ADD NEW BOOK
if ch==5:
print("FILL ALL BOOK DETAILS ")
book_name=str(input("enter book name:"))
book_no=str(input("Enter no (limit 5 characters):"))
genre=str(input("Enter genre:"))
authors_name=str(input("Enter the authors name (max 15 words):"))
language=str(input("Enter the language of book:"))
[Link]("insert into
bookvalues('"+book_name+"','"+book_no+"','"+genre+"','"+authors_name+"','"+language+"')")
[Link]()
print("Book added succesfully*")
for i in mycursor:
print(i)
#TO SEE BOOK DETAILS
if ch==6:
book_no=str(input("Enter Book No:"))
[Link]("select * from books where book_no='"+book_no+"'")
for i in mycursor:
print(i)
#TO UPDATE BOOK DETAILS
if ch==7:
print("press 1 to update Book name")
print(" ")
print("press 2 to update genre")
print(" ")
print("press 3 to update Author Name")
print(" ")
print("press 4 to update Language")
print(" ")
ch1=int(input("Enter your choice:"))
if ch1==1:
[Link]("select * from books")
for i in mycursor:
print(i)
book_no=str(input("Enter bookno:"))
name_of_book=str(input("Enter new name:"))
[Link]("update books set book_name='"+name_of_book+"' where
book_no='"+book_no+"'")
[Link]()
print("*Name has been updated*")
[Link]("select * from books")
for i in mycursor:
print(i)
#TO UPDATE GENRE
if ch1==2:
[Link]("select * from books")
for i in mycursor:
print(i)
book_no=str(input("Enter card no:"))
genre=str(input("Enter new genre:"))
[Link]("update books set genre='"+genre+"' where
book_no='"+book_no+"'")
[Link]()
print("*Genre has been updated*")
[Link]("select * from books")
for i in mycursor:
print(i)
#TO UPDATE AUTHOR NAME
if ch1==3:
[Link]("select * from books")
for i in mycursor:
print(i)
book_no=str(input("Enter book no:"))
author=str(input("Enter new authors name:"))
[Link]("update books set authors_name='"+author+"' where
book_no='"+book_no+"'")
[Link]()
print("*Authors name has been updated*")
[Link]("select * from books")
for i in mycursor:
print(i)
#TO UPDATE LANGUAGE
if ch1==4:
[Link]("select * from books")
for i in mycursor:
print(i)
book_no=str(input("Enter boom no:"))
language=str(input("Enter new language:"))
[Link]("update books set language='"+language+"' where
book_no='"+book_no+"'")
[Link]()
print("*Language has been updated*")
[Link]("select * from books")
for i in mycursor:
print(i)
#TO DELETE A BOOK
if ch==8:
[Link]("select * from books")
for i in mycursor:
print(i)
book_no=str(input("Enter book no:"))
[Link]("delete from books where book_no='"+book_no+"'")
[Link]()
print("*Removed succesfully*")
[Link]("select * from books")
for i in mycursor:
print(i)
#TO LEND A BOOK
if ch==9:
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:"))
book_name=str(input("Enter the name of the book:"))
date_of_lend=str(input("Enter date of lending(yyyy-mm-dd)"))
print("if book not returned then enter(0000-00-00):")
date_of_return=str(input("enter date of return(yyyy-mm-dd):"))
[Link]("insert into library_transaction
values('"+cardno+"','"+book_name+"','"+date_of_lend+"','"+date_of_return+"')")
[Link]()
#TO RETURN A BOOK
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):"))
[Link]("update library_transaction set
date_of_return='"+date_of_return+"' where cardno='"+cardno+"'")
[Link]()
#TO SEE LENDING HISTORY
if ch==11:
cardno=str(input("Enter card no:"))
[Link]("select * from library_transaction where cardno='"+cardno+"'")
for i in mycursor:
print(i)
#TO ORDER A NEW BOOK
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"))
[Link]("insert into buy_new_books
values('"+orderno+"','"+name_of_book+"','"+del_date+"','"+price+"')")
[Link]()
#TO UPDATE ORDER DETAILS
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:
[Link]("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:"))
[Link]("update buy_new_books set name_of_book='"+name_of_book+"'
where orderno='"+orderno+"'")
[Link]()
print("*Name has been updated*")
[Link]("select * from buy_new_books")
for i in mycursor:
print(i)
#TO UPDATE DELIVERY DATE
if ch1==2:
[Link]("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):"))
[Link]("update buy_new_books set del_date='"+del_date+"' where
orderno='"+orderno+"'")
[Link]()
print("*Delivery date has been updated*")
[Link]("select * from buy_new_books")
for i in mycursor:
print(i)
#TO UPDATE PRICE
if ch1==3:
[Link]("select * from buy_new_books")
for i in mycursor:
print(i)
orderno=str(input("Enter card no:"))
price=str(input("Enter new price:"))
[Link]("update buy_new_books set price='"+price+"' where
orderno='"+orderno+"'")
[Link]()
print("*Price has been updated*")
[Link]("select * from buy_new_books")
for i in mycursor:
print(i)
#TO DISPLAY ORDERING HISTORY
elif(ch==14):
orderno=str(input("Enter order number:"))
[Link]("select * from buy_new_books where orderno='"+orderno+"'")
for i in mycursor:
print(i)
#TO EXIT THE PROGRAM
elif ch==15:
break
else:
pass
cho=input("Choose wether you want to continue(y) or exit the system(n) : ")
OUTPUT
MENU
CREATING ACCOUNT
DISPLAY THE ACCOUNT
UPDATE THE ACCOUNT
ADDING BOOK
DISPLAY TE BOOK
UPDATE THE BOOK
ORDER THE BOOK
DISPLAY THE BOOK
LENDING THE BOOK
DISPLAY THE LEND
ORDER TABLE
BOOK TABLE
ACCOUNT TABLE
library_transaction
REQUIREMENTS
HARDWARE REQUIREMENTS
INTEL® CORE(TM) i3-8100 CPU @ 3.60GHz
4GB RAM
1 TB HARD DISK
15.6” HP MONITOR
GENIUS USB KEYBOARD
GENIUS USB MOUSE
NUMERIC 600VA UPS
SOFTWARE REQUIREMENTS
OS - WINDOWS 10
PYTHON 3.10
WAMP SERVER 5.1
REFFERENCE
Computer Science with Python – Sumita Arora
(Class XI and XII)
Computer Science with Python – Preethi Arora
(Class XI and XII)