Professional Documents
Culture Documents
UNDERTAKING
We declare that the work presented in this project titled “LIBRARY MANAGEMENT
SYSTEM”, submitted to Mr. Akshay Varshney PGT - Computer Science Army Public
School, LBS Marg for the award of the CBSE – AISSCE class XII certificate. For the
support of our work, we have attached a plagiarism report from Grammarly.com which is an
By:
1. ANUJ SINGH – XII B – ROLL NO__________________
2. SAKSHAM RAI – XII B – ROLL NO________________
3. AVISHEKH– XII B – ROLL NO____________________
_ 2
CERTIFICATE
It is certified that the work contained in the project titled “LIBRARY MANAGEMENT
SYSTEM”, by “Anuj Singh, Saksham Rai, and Avishekh”, has been carried out under my
supervision and that this has not been submitted elsewhere for an AISSCE certificate.
Mentor:
Project Guide:
_ 3
ACKNOWLEDGEMENT
We would like to thank Mrs. Meenakshi Jayaswal, Principal, Army Public School, LBS
Marg, Lucknow who gave us this golden opportunity to do this work and are deeply indebted
to our mentor Mr. Akshay Varshney for project guidance. We further say thanks to all the
members of Army Public School, LBS Marg. We also express our deepest gratitude to our
parents and our friends, as the project is a bridge between theoretical and practical learning
and with this thinking we worked on the project and made it successful in a given amount of
time.
_ 4
CONTENT
1. Introduction
2. System Requirements
3. Coding
4. Outcomes
5. References
_ 5
INTRODUCTION
Project Description
A Library Management System (LMS) is a software application that helps manage the operations of a
library. It includes functions like cataloguing books, tracking book availability, managing membership and
facilitating, borrowing and returning of books. Here's a project description for creating a Library
Management System using MySQL and Python as shown below:
METHODOLOGY
The project starts with ‘Menu based Input’ asked from the user as –
Enter1: Add a book: This menu will add an entry of a book by entering the required details.
Enter2: Update a book: This menu will update the details of a textbook.
Enter3: Delete a book: This menu will delete the details of a textbook by entering the book ID.
Enter4: Search for a book: This menu will search for the existence of a book by entering the book ID.
Enter5: Display all books: This menu will display the entries of all the books which are stored by the user in
this Library.
Enter6: Exit
_ 6
SYSTEM REQUIREMENTS
Note: – MySQL Connector Python requires Python to be in the system’s PATH. Installation fails if it
On Windows, If Python doesn’t exist in the system’s PATH, please manually add the directory containing
python.exe yourself.
_ 7
ROLE OF TEAM MEMBERS
_ 8
_ 9
CODING
import mysql.connector
mydb =
mysql.connector.connect(host="localhost",user="root",password="Seniorlab@123",database="library")
cursor = mydb.cursor()
def display_menu():
print("6. Exit")
def add_book():
_ 9
sql = "INSERT INTO books (book_title, book_author, book_published_year, book_id) VALUES
(%s, %s, %s, %s)"
cursor.execute(sql, val)
mydb.commit()
def update_book():
sql = "UPDATE books SET book_title = %s, book_author = %s, book_published_year = %s WHERE
book_id = %s"
cursor.execute(sql, val)
mydb.commit()
def delete_book():
val = (book_id, )
_ 10
cursor.execute(sql, val)
mydb.commit()
def search_book():
book_title = input("Enter the title of the book you want to search: ")
val = (book_title, )
cursor.execute(sql, val)
result = cursor.fetchall()
if not result:
else:
print("ID:", book[0])
print("Title:", book[1])
print("Author:", book[2])
print()
def display_books():
cursor.execute(sql)
result = cursor.fetchall()
if not result:
_ 11
print("No books in the library.")
else:
print("ID:", book[0])
print("Title:", book[1])
print("Author:", book[2])
print()
while True:
display_menu()
if choice == '1':
add_book()
update_book()
delete_book()
search_book()
display_books()
break
else:
_ 12
# Close the cursor and the MySQL connection
cursor.close()
mydb.close()
_ 13
OUTCOMES
MAIN SCREEN
_ 14
ADDING A BOOK
_ 15
UPDATING A BOOK
_ 16
DELETING A BOOK
_ 17
SEARCHING FOR A BOOK
_ 18
SEARCHING FOR A BOOK
_ 19
DISPLAYING ALL THE BOOKS
_ 20
EXIT
_ 21
REFERENCES
1. https://python.org
2. https://tutorialsPoint.com
3. https://Pythonguides.com
4. https://LearnPython.org
5. https://geeksforgeeks.org
_ 22