Library Management System
Library Management System
On
LIBRARY MANAGEMENT SYSTEM
For
AISSCE 2024 Examination
[As a part of the Computer Science Course (083)]
Submitted By
Name:
Board Roll No:
VIVEK VIDYALAYA
JAMSHEDPUR
CERTIFICATE
has been carried out under my direct supervision and guidance. This
report or a similar report on the topic has not been submitted for any
other examination and does not form a part of any other course
…………………………………… ……………………………………
Signature of Student Signature of Teacher/Guide
Place: Jamshedpur
Date:
ACKNOWLEDGMENT
I undertook this Project work, as the part of my XII-Computer Science
course. I had tried to apply my best of knowledge and experience,
gained during the study and class work experience. However,
developing software system is generally a quite complex and time-
consuming process. It requires a systematic study, insight vision and
professional approach during the design and development.
Moreover, the developer always feels the need, the help and good
wishes of the people near you, who have considerable experience
and idea.
Prem Tiwari
Class XII (Science)
CONTENT
1. Introduction
2. Theoretical Background
3. System Implementation
4.1Database Design:
5. User Manual
6. References
3.1 What is Database?
Introduction and Concepts:
A database is a collection of information related to a particular subject or
purpose, such as tracking customer orders or maintaining a music
collection. Using any RDBMS application software like MS SQL Server,
MySQL, Oracle, Sybase etc, you can manage all your information from a
single database file. Within the file, divide your data into separate storage
containers called tables. You may and retrieve the data using queries.
To find and retrieve just the data that meets conditions you specify,
including data from multiple tables, create a query. A query can also
update or delete multiple records at the same time, and perform built-in
or custom calculations on your data.
The data stored can be sorted or indexed at the user's discretion and
direction.
MySQL, the most popular Open Source SQL database management system, is developed,
distributed, and supported by Oracle Corporation. MySQL is named after co-founder Monty
Widenius's daughter, My. The name of the MySQL Dolphin (our logo) is “Sakila,”.
What is Python?
Python is a popular programming language. It was created by Guido van
Rossum, and released in 1991.
It is used for:
Why Python?
Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
Python has a simple syntax similar to the English language.
Python has syntax that allows developers to write programs with fewer lines
than some other programming languages.
Python runs on an interpreter system, meaning that code can be executed as
soon as it is written. This means that prototyping can be very quick.
Python can be treated in a procedural way, an object-orientated way or a
functional way.
Good to know?
The most recent major version of Python is Python 3, which we shall be using in
this tutorial. However, Python 2, although not being updated with anything
other than security updates, is still quite popular.
In this tutorial Python will be written in a text editor. It is possible to write
Python in an Integrated Development Environment, such as Thorny, Pycharm,
Netbeans or Eclipse which are particularly useful when managing larger
collections of Python files.
Hardware used:
Softwares used:
defMenuBook():
while True:
Book.clrscreen()
print("\t\t\t Book Record Management\n")
print("========================================================
======")
print("1. Add Book ")
Record
print("2. Display Book ")
Records
print("3. Search Book ")
Record
print("4. Delete Book ")
Record
print("5. Update Book ")
Record
print("6. Return to Main ")
Menu
print("===========================================================
====")
choice=int(input("Enter Choice between 1 to 5-------> :
")) if choice==1:
Book.insertData()
elifchoice==2:
Book.display()
elifchoice==3:
Book.SearchBookRec() elif
choice==4:
Book.deleteBook()
elifchoice==5:
print("No such Function") elif
choice==6:
return else:
print("WrongChoice. Enter Your Choiceagain")
x=input("Enter any key to continue")
#----------------------------------------------------------------------------------------
defMenuMember(): while
True:
Book.clrscreen()
print("\t\t\t Member Record Management\n")
print("================================================
==============")
print("1. Add Member ")
Record
print("2. Display Member ")
Records
print("3. Search Member ")
Record
print("4. Delete Member ")
Record
print("5. Update Book ")
Record
print("6. Return to Main ")
Menu
print("==================================================
=============")
choice=int(input("Enter Choice between 1 to
5-------> : ")) if choice==1:
Member.insertDa
ta() elifchoice==2:
Member.displ
ay()
elifchoice==3:
Member.SearchMe
mber() elif
choice==4:
Member.deleteMem
ber() elif choice==5:
print("No such
Function") elif
choice==6:
retu
rn
else:
print("WrongChoice. Enter Your Choiceagain")
x=input("Enter any key to continue")
#----------------------------------------------------------------------------------------
defMenuIssueReturn():
while True:
Book.clrscreen()
print("\t\t\t Member Record Management\n")
print("================================================
==============")
print("1.IssueBook ")
print("2. Display
IssuedBookRecords ")
print("3. ReturnIssuedBook
")
print("4. Return to Main Menu")
print("==================================================
=============")
choice=int(input("Enter Choice between 1 to
5-------> : ")) if choice==1:
issue.issueBookD
ata() elif
choice==2:
issue.ShowIssuedBo
oks() elif choice==3:
issue.returnB
ook()
elifchoice==4:
retu
rn
else:
print("WrongChoice. Enter Your Choiceagain")
x=input("Enter any key to continue")
while True:
Book.clrscreen()
print("\t\t\t Library Management\n")
print("================================================
==============")
print("1.BookManagement ")
print("2.
MembersManagements "
) print("3.Issue/ReturnBook
")
print("5.Exit ")
print("====================================================
===========")
choice=int(input("Enter Choice between 1 to
4-------> : ")) if choice==1:
MenuLib.MenuBoo
k() elifchoice==2:
MenuLib.MenuMe
mber() elif
choice==3:
MenuLib.MenuIssueReturn()
elif choice==4:
bre
ak
else:
print("WrongChoice. Enter Your Choiceagain")
x=input("Enter any key to continue")
importmysql.conn
ector
frommysql.connector import errorcode
fromdatetime import date, datetime,
timedelta from mysql.connector
import (connection) import os
import platform
defclrscreen():
ifplatform.system()=="Windows":
print(os.system("cls"))
def
display(
): try:
os.system('cls')
cnx = connection.MySQLConnection(user='root',
password='mysql', host='localhost',
database='LIbr
ary') Cursor =
cnx.cursor()
query = ("SELECT * FROM
BookRecord")
Cursor.execute(query)
Cursor.clo
se()
cnx.close(
)
print("You have done
it!!!!!!") except
mysql.connector.Error as
err:
iferr.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name
or password") eliferr.errno ==
errorcode.ER_BAD_DB_ERROR: print("Database
does not exist")
else:
print(e
rr) else:
cnx.close()
definsertDat
a(): try:
cnx = connection.MySQLConnection(user='root',
password='m
ysql',
host='127.0.0
.1',
database='Libr
ary') Cursor = cnx.cursor()
bno=input("EnterBookCode : ")
bname=input("EnterBookName :
") Auth=input("Enter
BookAuthor'sName : ")
price=int(input("Enter Book Price :
")) publ=input("Enter
PublisherofBook :")
qty=int(input("EnterQuantity purchased : "))
print("Enter Date of Purchase (Date/MOnth and
Year seperately: ") DD=int(input("EnterDate :"))
MM=int(input("Enter Month : "))
YY=int(input("Enter Year : "))
Qry = ("INSERT INTO BookRecord "\
"VALUES (%s, %s, %s, %s, %s, %s, %s)")
data =
(bno,bname,Auth,price,publ,qty,date(YY,M
M,DD)) Cursor.execute(Qry,data)
# Make sure data is committed to
the database cnx.commit()
Cursor.clo
se()
cnx.close(
)
print("RecordInserted....")
exceptmysql.connector.Error as err:
iferr.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name
or password")
eliferr.errno ==
errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(e
rr)
cnx.clos
e()
defdeleteBo
ok(): try:
cnx = connection.MySQLConnection(user='root',
password='m
ysql',
host='127.0.0
.1',
database='Libr
ary') Cursor = cnx.cursor()
rr)
cnx.clos
e()
defSearchBookR
ec(): try:
cnx = connection.MySQLConnection(user='root',
password='m
ysql',
host='127.0.0
.1',
database='Libr
ary') Cursor = cnx.cursor()
rec_srch=(bno,)
Cursor.execute(query,re
c_srch)
Rec_count=0
exceptmysql.connector.Error as err:
iferr.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name
or password")
eliferr.errno ==
errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(err)
cnx.close(
)
defUpdateBo
ok():
try:
cnx = connection.MySQLConnection(user='root',
password='m
ysql',
host='127.0.0
.1',
database='Libr
ary') Cursor = cnx.cursor()
Cursor.execute(Qry,data)
# Make sure data is committed to the
database''' cnx.commit()
Cursor.clo
se()
cnx.close(
)
print(Cursor.rowcount,"Record(s)UpdatedSuccessfully ")
exceptmysql.connector.Erro
r as err:
iferr.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name
or password")
eliferr.errno ==
errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(e
rr)
cnx.clos
e()
UpdateBook()
importmysql.connector
frommysql.connector import
errorcode from datetime
import date
frommysql.connector import
(connection) import os
defclrscree
n():
print('\n'
*5)
defShowIssuedBo
oks(): try:
os.system('cls')
cnx = connection.MySQLConnection(user='root',
password='mysql', host='localhost',
database='Libr
ary') Cursor =
cnx.cursor()
query = ("SELECT B.bno,bname,M.mno,mname,d_o_issue,d_o_ret FROM
bookRecordB,issue I"\ ",member M where B.bno=I.bno and
I.mno=M.mno")
Cursor.execute(query)
print("=================================================
==============")
Cursor.clo
se()
cnx.close(
)
print("You have done
it!!!!!!") except
mysql.connector.Error as
err:
iferr.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name
or password") eliferr.errno ==
errorcode.ER_BAD_DB_ERROR: print("Database
does not exist")
else:
print(e
rr) else:
cnx.close()
defissueBoo
k(): try:
cnx = connection.MySQLConnection(user='root',
password='m
ysql',
host='127.0.0
.1',
database='Libr
ary') Cursor = cnx.cursor()
)
cnx.clos
()
defreturnBook():
try:
cnx = connection.MySQLConnection(user='root',
password='m
ysql',
host='127.0.0
.1',
database='Libr
ary') Cursor = cnx.cursor()
cnx.close()
PYTHON MODULE MEMBER
importmysql.connector
frommysql.connector import errorcode
fromdatetime import date, datetime,
timedelta from mysql.connector
import (connection) import os
defclrscree
n():
print('\n'
*5)
def
display(
): try:
os.system('cls')
cnx = connection.MySQLConnection(user='root', password='mysql',
host='localhos
t',
database='LIbr
ary')
Cursor = cnx.cursor()
query = ("SELECT * FROM
Member")
Cursor.execute(query)
Cursor.clo
se()
cnx.close(
)
print("You have done
it!!!!!!") except
mysql.connector.Error as
err:
iferr.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name
or password") eliferr.errno ==
errorcode.ER_BAD_DB_ERROR: print("Database
does not exist")
else:
print(e
rr) else:
cnx.close()
definsertMemb
er(): try:
cnx = connection.MySQLConnection(user='root',
password='mysql',
host='127.0.0.1',
database='Libr
ary') Cursor = cnx.cursor()
mno=input("EnterMemberCode: ")
mname=input("EnterMemberNam
e : ")
mob=input("Enter
MemberMobileNo. :")
print("Enter Date of Membership (Date/MOnth and
Year seperately: ") DD=int(input("EnterDate :"))
MM=int(input("Enter Month : "))
YY=int(input("Enter Year : "))
addr=input("Enter Member Adress :
")
Qry = ("INSERT INTO
Member "\ "VALUES
(%s, %s, %s, %s, %s)")
data =
(mno,mname,mob,date(YY,MM,DD),a
ddr) Cursor.execute(Qry,data)
# Make sure data is committed to
the database cnx.commit()
Cursor.clo
se()
cnx.close(
)
print("RecordInserted....")
exceptmysql.connector.Error as err:
iferr.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name
or password")
eliferr.errno ==
errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(e
rr)
cnx.clos
e()
defdeleteMemb
er(): try:
cnx = connection.MySQLConnection(user='root',
password='m
ysql',
host='127.0.0
.1',
database='Libr
ary') Cursor = cnx.cursor()
rr)
cnx.clos
e()
defSearchMem
ber(): try:
cnx = connection.MySQLConnection(user='root',
password='m
ysql',
host='127.0.0
.1',
database='Library')
Cursor = cnx.cursor()
Rec_count=0
exceptmysql.connector.Error as err:
iferr.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or
password")
eliferr.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(err)
cnx.close()
REFERENCES
In order to work on this project titled –Library Management System, the following
books and literature are referred by me during the various phases of development of
the project.
(4) http://www.python.org/