0% found this document useful (0 votes)
12 views52 pages

Anand Swaroop Arya

The document outlines a project report for a Library Management System developed by students of Saraswati Vidya Mandir for the AISSCE 2024-25 examination. It details the project's objectives, system implementation, and the technologies used, including Python and MySQL. The report also includes sections on theoretical background, system design, user manual, and acknowledgments, highlighting the project's aim to automate library record-keeping and enhance decision-making.

Uploaded by

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

Anand Swaroop Arya

The document outlines a project report for a Library Management System developed by students of Saraswati Vidya Mandir for the AISSCE 2024-25 examination. It details the project's objectives, system implementation, and the technologies used, including Python and MySQL. The report also includes sections on theoretical background, system design, user manual, and acknowledgments, highlighting the project's aim to automate library record-keeping and enhance decision-making.

Uploaded by

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

LIBRARY MANAGEMENT SYSTEM

Anand Swaroop Arya


Saraswati Vidya
Mandir

Session:- 2024-2025
FOR AISSCE 2024-25
EXAMINATION
[AS A PART OF THE COMPUTER SCIENCE
COURSE (083)]
SUBMITTED BY: - UNDER THE GUIDANCE
OF:
NAME.-CLASS-
SR.NO.
1.KUSH.- XII C -11115. Mr. Vineet Gupta
2. MUDASSIR.-XII D -9030 PGT (COMP.SC)
3. KRISH YADAV.-XII D -

1
LIBRARY MANAGEMENT SYSTEM

A PROJECT
REPORT ON

LIBRARY
MANAGEMENT
SYSTEM

FOR AISSCE :-All India Senior


School Certificate Examination
SESSION:- 2024-25
[AS A PART OF THE COMPUTER SCIENCE
COURSE (083)]

2
LIBRARY MANAGEMENT SYSTEM

CERTIFICATE

This is to certify that the Project / Dissertation entitled

Library Management System is a bonafide

work done by KUSH , MUDASSIR AND KRISH

YADAV of class

XII Session 2024-25 in partial fulfillment of CBSE’s

AISSCE Examination 2024 and 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 undergone by the candidate.


………………………… ……………………………..
Signature of Signature of
Students Teacher/Guide

NAME.-CLASS-
SR.NO.
1.KUSH.- XII C -11115. Mr. Vineet Gupta
2. MUDASSIR.-XII D -9030 PGT (COMP.SC)
3. KRISH YADAV.-XII D -

3
LIBRARY MANAGEMENT SYSTEM

ACKNOWLEDGEMENT
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 systems 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 ideas.

I would like to extend my sincere thanks and gratitude to my teacher

Mr. Vineet Gupta , for giving valuable time and moral


support to develop this software.

I also feel indebted to my friends for the valuable suggestions during


the project work.

Class XII

4
LIBRARY MANAGEMENT SYSTEM

CONTENTS

1. Introduction 5

2. Objective & Scope of the Project 7

3. System Implementation 9

3.1 The Hardware 9


used:
3.2 The Softwares 9
used:
4. Theoretical Background------------------------------------
10
1. What is 10
Database?
1
2. What is MySQL? 2
1
3. What is Python? 5
5. System Design & Development ------
17
5.1 Database 1
Design: 7
5.2 Event Coding:
21

6. Output------------------------------------------------------------------------35

7. User Manual
45

1. How to install:
45

2. Working with Software:


45

8. References
47

5
LIBRARY MANAGEMENT SYSTEM

1. Introduction
This software project is developed to automate the functionalities of a
travel agency.The purpose of the software project is to develop the
Management Information System (MIS) to automate the record keeping
of books, Members ,issue types and return transactions with a view to
enhance the decision making of the functionaries.

A MIS mainly consists of a computerized database, a collection of


inter-related tables for a particular subject or purpose, capable to
produce different reports relevant to the user. An application program is
tied with the database for easy access and interface to the database.
Using Application program or front-end, we can store, retrieve and
manage all information in proper way.

This software, being simple in design and working, does not


require much of training to users, and can be used as a powerful
tool for automating a LIBRARY M A NAGE M E N T SYSTEM.

During coding and design of the software Project, Java NetBeans IDE,
a powerful front-end tool is used for getting Graphical User
Interface (GUI) based integrated platform and coding simplicity. As a
back-end a powerful, open source RDBMS, My SQL is used as per
requirement of the CBSE curriculum of Informatics Practices Course.

6
LIBRARY MANAGEMENT SYSTEM

2. Objective & Scope of the Project


The objective of the software project is to develop a computerized
SYSTEM. This software project is also aimed to enhance the current
record keeping system, which will help managers to retrieve the
up-to-date information at right time in right shape.
The proposed software system is expected to do the following
functionality-

✔ To provide a user friendly, Graphical User Interface (GUI) based

integrated and centralized environment for MIS activities.

✔ The proposed system should maintain all


the records and

transactions, and should generate the required


reports and information when required.

✔ To provide graphical and user-friendly interface to interact with a

centralized database based on client-server architecture.

✔ To identify the critical operation procedure and possibilities of

simplification using modern IT tools and practices.

In its current scope, the software enables user to retrieve and update the
information from centralized database designed with MySQL . This
software does not require much training time of the users due to limited
functionality and simplicity.

During the development of the LIBRARY MANAGEMENT


SYSTEM
project, Python IDE, a powerful, open source event-driven form-based
7
LIBRARY MANAGEMENT SYSTEM

development environment is used for modular design and future


expandability of the system.

Despite the best effort of the developer, the following limitations and
functional boundaries are visible, which limits the scope of this
application software.

1. This software can store records and produce reports in


pre-designed format in soft copy. There is no facility yet to produce
customized reports. Only specified reports are covered.

2. There is no provision to calculate fine or penalty etc. for defaulter


members; however it can be developed easily with the help of
adding modules.

3. Some application area like accounting of vehicles and fines etc. are
not implemented in the project. It facilitates manager to record
and update only transaction record.

So far as future scope of the project is concerned, firstly it is open to any


modular expansion i.e. other modules or functions can be designed and
embedded to handle the user need in future. Any part of the software
and reports can be modified independently without much effort.

8
LIBRARY MANAGEMENT SYSTEM

3. System Implementation

1. The Hardware used:

While developing the system, the used hardware are:

PC with Intel Core i5-2400S processor having 4.00 GB RAM, 64-bit


Operating System and other required devices.

2. The Softwares used:

□ Microsoft Windows® 10 as Operating System.

□ Python 3.7.2 as Front-end Development environment.

□ MySQL as Back-end Sever with Database for Testing.

□ MS-Word 2010 for documentation.

9
LIBRARY MANAGEMENT SYSTEM

4. Theoretical Background

4.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.

A table is a collection of data about a specific topic, such as products or


suppliers. Using a separate table for each topic means you can store that
data only once, which makes your database more efficient and reduces
data-entry errors. Table organises data into columns (called fields) and
rows (called records).

A Primary key is one or more fields whose value or values uniquely


identify each record in a table. In a relationship, a primary key is used to
refer to specific record in one table from another table. A primary key is
called foreign key when it is referred to from another table.

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.

Role of RDBMS Application Program:


A computer database works as a electronic filing system, which has a
large number of ways of cross-referencing, and this allows the user
many different ways in which to re-organize and retrieve data. A
database can handle business inventory, accounting and filing and use
the information in its files to prepare summaries, estimates and other

10
LIBRARY MANAGEMENT SYSTEM

reports. The management of data in a database system is done by means


of a general-purpose software package called a Database Management
System (DBMS). Some commercially available DBMS are MS SQL Server,
MS ACCESS, INGRES, ORACLE, and Sybase. A database management
system, therefore, is a combination of hardware and software that can be
used to set up and monitor a database, and can manage the updating
and retrieval of a database that has been stored in it. Most of the
database management systems have the following capabilities:

♦ Creating a table, addition, deletion, modification of records.

♦ Retrieving data collectively or selectively.

♦ The data stored can be sorted or indexed at the user's discretion


and direction.
♦ Various reports can be produced from the system. These may be
either standardized reports or that may be specifically generated
according to specific user definition.
♦ Mathematical functions can be performed and the data stored in
the database can be manipulated with these functions to perform
the desired calculations.
♦ To maintain data integrity and database use.

The DBMS interprets and processes users' requests to retrieve


information from a database. In most cases, a query request will have to
penetrate several layers of software in the DBMS and operating system
before the physical database can be accessed. The DBMS responds to a
query by invoking the appropriate subprograms, each of which
performs its special function to interpret the query, or to locate the
desired data in the database and present it in the desired order.

11
LIBRARY MANAGEMENT SYSTEM

4.2 What is My
SQL ?

The management of data in a database system is done by means of a


general-purpose software package called a Database Management
System (DBMS). Some commercially available RDBMS are MS SQL
Server, MS ACCESS, INGRES, ORACLE, and Sybase.

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,”.
● MySQL is a database management system.
A database is a structured collection of data. It may be anything
from a simple shopping list to a picture gallery or the vast
amounts of information in a corporate network. To add, access,
and process data stored in a computer database, you need a
database management system such as MySQL Server. Since
computers are very good at handling large amounts of data,
database management systems play a central role in computing, as
standalone utilities, or as parts of other applications.
● MySQL is based on SQL.
A relational database stores data in separate tables rather than
putting all the data in one big storeroom. This adds speed and
flexibility. The SQL part of “MySQL” stands for “Structured Query
Language.” SQL is the most common standardized language used
to access databases and is defined by the ANSI/ISO SQL Standard.
The SQL standard has been evolving since 1986 and several
versions exist. In this manual, “SQL-92” refers to the standard
released in 1992, “SQL:1999” refers to the standard released in
1999, and “SQL:2003” refers to the current version of the standard.

12
LIBRARY MANAGEMENT SYSTEM

● MySQL software is Open Source.


Open Source means that it is possible for anyone to use and
modify the software. Anybody can download the MySQL software
from the Internet and use it without paying anything. If you wish,
you may study the source code and change it to suit your needs.
The MySQL software uses the GPL (GNU General Public License),
● The MySQL Database Server is very fast, reliable,
and easy to use.
If that is what you are looking for, you should give it a try. MySQL
Server also has a practical set of features developed in close
cooperation with our users. You can find a performance
comparison of MySQL Server with other database managers on
our benchmark page. MySQL Server was originally developed to
handle large databases much faster than existing solutions and has
been successfully used in highly
demanding production environments for several
years. todayAlthough
development, MySQL Server under
offers a rich constant
and useful set of
functions. Its connectivity, speed, and security make MySQL
Server highly suited for accessing databases on the Internet.
● MySQL Server works in client/server or embedded
systems.
The MySQL Database Software is a client/server system that
consists of a multi-threaded SQL server that supports different
backends, several different client programs and libraries,
administrative tools, and a wide range of application
programming interfaces (APIs).

The Main Features of MySQL

● Written in C and C++.


● Works on many different platforms.
● Uses multi-layered server design with independent modules.
● Provides transactional and non transactional storage engines.

13
LIBRARY MANAGEMENT SYSTEM

● Designed to make it relatively easy to add other storage engines.


This is useful if you want to provide an SQL interface for an
in-house database.
● Uses a very fast thread-based memory allocation system.
● Executes very fast joins using an optimized nested-loop join.
● Implements SQL functions using a highly optimized class library
that should be as fast as possible. Usually there is no memory
allocation at all after query initialization.
● Provides the server as a separate program for use in a client/server
networked environment, and as a library that can be embedded
(linked) into standalone applications. Such applications can be
used in isolation or in environments where no network is
available.
● Password security by encryption of all password traffic when you
connect to a server.
● Support for large databases. We use MySQL Server with databases
that contain 50 million records. We also know of users who use
MySQL Server with 200,000 tables and about 5,000,000,000 rows.
● MySQL client programs can be written in many languages. A
client library written in C is available for clients written in C or
C++, or for any language that provides C bindings.
● APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl are
available, enabling MySQL clients to be written in many
languages.
● The Connector/ODBC (MyODBC) interface provides MySQL
support for client programs that use ODBC (Open Database
Connectivity) connections.
● The Connector/J interface provides MySQL support for Java client
programs that use JDBC connections. Clients can be run on
Windows or Unix. Connector/J source is available.

14
LIBRARY MANAGEMENT SYSTEM

4.3 What is Python ?


Python is an open source , object oriented high level programming
language developed by Guido Van Rossum in 1991 at the National
Research Institute for Mathematics,Netherlands.
Features of Python:
● It is an interactive ,interpreted language.
● It is a loosely typed object –oriented language.
● It is a free open –source and portable language,
● It takes less time to develop programs.
● It is extensible / extendable and highly efficient .
● It supports GUI.
● It can be easily compatible with other languages like C , C++ etc.
● It is used for both scientific and non-scientific programming.

Installing Python:
It can be installed by using website :
https://www.python.org/downloads/

Interacting with Python:


Python programs can be run in two ways:
● Using Command line window

15
LIBRARY MANAGEMENT SYSTEM

● Using IDLE

16
LIBRARY MANAGEMENT SYSTEM

5. System Design & Development

5.1 Database Design:


An important aspect of system design is the design of data storage
structure. To begin with, a logical model of data structure is developed
first. A database is a container object which contains tables, queries,
reports and data validation policies, enforcement rules or constraints etc.
Logical data often represented as records are kept in different tables after
reducing anomalies and redundancies. The goodness of database design
lies in the table structure and its relationship.

This software project maintains a database named lIBTARAY which


contains the following tables.

Table Design:
The database of the LIBRARY MANAGEMENT SYSTEM
contains 3 tables in the database Library. The tables are normalized to
minimize the redundancies of data and enforce the validation
rules of the organization. Most of the tables are designed to store
master records. The tables and their structure are given below.

Table 1: BOOK
RECORD

17
LIBRARY MANAGEMENT SYSTEM

18
LIBRARY MANAGEMENT SYSTEM

Table2: MEMBER

19
LIBRARY MANAGEMENT SYSTEM

Table3: ISSUE

20
LIBRARY MANAGEMENT SYSTEM

TABLE JOIN

21
LIBRARY MANAGEMENT SYSTEM

5.2 Event Coding:


#MODULE : LIBRARY MANAGEMENT

import MenuLib
import Book
import issue
while True:
Book.clrsc
reen()
print("\t\t\t Library Management\n")
print("=========================================
=====================")
print("1. Book Management ")
print("2. Members Management s ")
print("3. Issue/Return Book ")
print("5. Exit ")
print("===========================
==============
======================")
choice=int(input("Enter Choice between 1 to
4-------> : "))
if choice==1:
MenuLib.MenuBook()
elif choice==2:
MenuLib.MenuMe
mber()
elif choice==3:
MenuLib.MenuIssueReturn()
elif choice==4:
break
else:
p
rint(
"Wron
g
Choic
e....
..Ent
er
Your
Choic
e
again
22
")
x=input("
LIBRARY MANAGEMENT SYSTEM

#PYTHON MODULE :MENULIB


import Book
import Member
import issue

def MenuBook():
while True:
Book.clrscr
een()
print("\t\
t\t
Book
Record
Managem
ent\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()
elif choice==2:
Book.display(
)
elif choice==3:
Book.SearchBookRec()
elif choice==4:
Book.deleteBook()
elif choice==5:
print("No
23
such Function")
elif choice==6:
return
LIBRARY MANAGEMENT SYSTEM

#
-

def MenuMember():
while True:
Book.clrscree
n()
print("\t\t\t
Member
Record
Managemen
t\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.insertData()
elif choice==2:
Member.display(
)
elif choice==3:
Member.SearchMember()
elif choice==4:
Member.deleteMember()
elif choice==5:
print("No such
Function")
elif choice==6:
24
return
else:
print("Wrong Choice......Enter Your
LIBRARY MANAGEMENT SYSTEM

def MenuIssueReturn():
while True:
Book.clrscreen()
print("\t\t\t Issue/Return Record
Management\n")

print("======================
===================
=====================")
print("1. Issue Book ")
print("2. Display Issued Book
Records ") print("3. Return Issued Book
") print("4. Return to Main Menu ")

print("==================================
===========
==================")
choice=int(input("Enter Choice between 1 to
5-------> : "))
if choice==1:
issue.issueBookData()
elif choice==2:
issue.ShowIssuedB
ooks()
elif choice==3:
issue.returnBook()
elif choice==4:
return
else:
pr
int("W
rong
Choice
......
Enter
Your
Choice again")
x=
input(
"Enter
any
key to
contin 25
ue")
LIBRARY MANAGEMENT SYSTEM

# PYTHON MODULE : BOOK


import mysql.connector
from mysql.connector import errorcode
from datetime import date, datetime, timedelta
from mysql.connector import (connection)
import os
import platform
def clrscreen():
if platform.system()=="Windows":
print(os.system("cls"))
def display():
try:
os.system('cls') cnx
=
connection.MySQLConnectio
n(user='root',
password=‘h’,
host='localhost',
database='LIbrary')
Cursor = cnx.cursor()
query = ("SELECT * FROM
BookRecord")
Cursor.execute(query)
for (Bno,Bname,Author,price,publ,qty,d_o_purchase)
in Cursor:
print("=========================================
=====================")
print("Book Code : ",Bno)
print("Book Name : ",Bname)
print("Author of Book : ",Author)
print("Price of Book : ",price)
print("Publisher : ",publ)
print("Total Quantity in Hand : ",qty)
print("Purchased On : ",d_o_purchase)
print("===========================
==================
==================")
Cursor.clo
se()
cnx.close()
print("You
have done
it!!!!!!")
except
mysql.connecto
r.Error as 26
err:
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
LIBRARY MANAGEMENT SYSTEM

else:
print(err)
else:
cnx.cl
ose()
def insertData():
try:
cnx =
connection.MySQLConnection(user='root',
password=‘h’,
host='127.0.0.1', database='Library')
Cursor = cnx.cursor()
bno=input("Enter Book Code : ")
bname=input("Enter Book Name : ")
Auth=input("Enter Book Author's
Name : ")
price=int(input("Enter Book Price : "))
publ=input("Enter Publisher of Book : ")
qty=int(input("Enter Quantity purchased : "))
print("Enter Date of Purchase (Date/MOnth and Year
seperately: ")
DD=int(input("Enter Date : "))
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,MM,DD))
Cursor.execute(Qry,data)

# Make sure data is committed to the database

cnx.commit()
Cursor.close()
cnx.close()
print("Record
Inserted......
........")
except
mysql.connecto
r.Error as
err:
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or
password") 27
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
LIBRARY MANAGEMENT SYSTEM

def deleteBook():
try:
cnx =
connection.MySQLConnection(user='root',
password=‘h’,
host='127.0.0.1', database='Library')
Cursor = cnx.cursor()
bno=input("Enter Book Code of Book to be deleted
from the Library : ")
Qry =("""DELETE FROM BookRecord WHERE BNO =
%s""")
del_rec=(bno,)
Cursor.execute(Qry,del_rec)

# Make sure data is committed to the


database

cnx.commit()
Cursor.close()
cnx.close()
print(Cursor.r
owcount,"Recor
d(s) Deleted
Successfully..
...........")
except mysql.connector.Error as err:
if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user
name or password")
elif err.errno ==
errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(err)
cnx.close()

def SearchBookRec():
try:
cnx =
connection.MySQLConnection(user='root',
password=‘h’,
host='127.0.0.1', database='Library)
Cursor = cnx.cursor()
bno=input("Enter Book No to be Searched from the
Library : ") 28
query = ("SELECT * FROM BookRecord where BNo =
%s ")
LIBRARY MANAGEMENT SYSTEM

rec_srch=(bno,)
Cursor.execute(query,rec_srch)
Rec_count=0

for (Bno,Bname,Author,price,publ,qty,d_o_purchase)
in Cursor:
Rec_count+=1
print("========================================
=
=====================")
print("Book Code : ",Bno)
print("Book Name : ",Bname)
print("Author of Book : ",Author)
print("Price of Book : ",price)
print("Publisher : ",publ)
print("Total Quantity in Hand :
",qty)
print("Purchased On : ",d_o_purchase)
print("=============================================
==================")
if Rec_count%2==0:
input("Press any key to continue")
clrscreen()
print(Rec_count, "Record(s)
found")

# Make sure data is committed to


the database

cnx.commit
()
Cursor.close()
cnx.close()
except
mysql.connecto
r.Error as
err:
if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is
wrong with your user
name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else: 29
print(err)
cnx.close()
LIBRARY MANAGEMENT SYSTEM

def UpdateBook():
try:
cnx =
connection.MySQLConnection(user='root',
password=‘h’,
host='127.0.0.1', database='Library')
Cursor = cnx.cursor()
bno=input("Enter Book Code of Book to be Updated
from the Library : ")
query = ("SELECT * FROM BookRecord where BNo =
%s ")
rec_srch=(bno,)
print("Enter new data ")
bname=input("Enter Book
Name : ")
Auth=input("Enter Book Author's Name : ")
price=int(input("Enter Book Price : "))
publ=input("Enter Publisher of Book : ")
qty=int(input("Enter Quantity purchased : "))
print("Enter Date of Purchase (Date/MOnth and Year
seperately: ")
DD=int(input("Enter Date : "))
MM=int(input("Enter Month : "))
YY=int(input("Enter Year : "))
Qry = ("UPDATE BookRecord SET
bname=%s,Author=%s,"\
"price=%s,publisher=%s,qty=%s,d_o_purchase=%s "\
"WHERE BNO=%s")
data =
(bname,Auth,price,publ,qty,date(YY,MM,DD),bno)
Cursor.execute(Qry,data)

# Make sure data is committed to the


database'''

cnx.commit()
Cursor.close()
cnx.close()
print(Cursor.r
owcount,"Recor
d(s) Updated
Successfully..
...........")
except
mysql.connecto
r.Error as 30
err:
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
LIBRARY MANAGEMENT SYSTEM

else:
print(err)
cnx.close()
UpdateBook()

#PYTHON
MODULE :
ISSUE

import
mysql.connec
tor
from mysql.connector import errorcode
from datetime import date
from mysql.connector import
(connection)
import os
def clrscreen():
print('\n' *5)

def ShowIssuedBooks():
try:
os.system('cls')
cnx = connection.MySQLConnection(user='root',
password=‘h’,
host='localhost', database='Library')
Cursor = cnx.cursor()
query = ("SELECT
B.bno,bname,M.mno,mna
me,d_o_issue,d_o_ret
FROM
bookRecord B,issue
I"\
",member M where B.bno=I.bno and I.mno=M.mno")
Cursor.execute(query)

for (Bno,Bname,Mno,Mname,doi,dor) in Cursor:


print("=========================================
=====================")
print("Book Code : ",Bno)
print("Book Name : ",Bname)
print("Member Code : ",Mno)
print("Member Name : ",Mname)
print("Date of issue :31 ",doi)
print("Date of return : ",dor)
print("============================
LIBRARY MANAGEMENT SYSTEM

32
LIBRARY MANAGEMENT SYSTEM

print("You have done it!!!!!!")


except mysql.connector.Error as err:
if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or
password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(err)
else:
cnx.close()

def issueBook():
try:
cnx =
connection.MySQLConnection(user='root',
password=‘h’,
host='127.0.0.1', database='Library')
Cursor = cnx.cursor()
bno=input("Enter Book Code to issue : ")
mno=input("Enter Member Code : ")
print("Enter Date of Issue (Date/MOnth
and Year
seperately: ")
DD=int(input("Enter Date : "))
MM=int(input("Enter Month : "))
YY=int(input("Enter Year : "))
Qry = ("INSERT INTO issue
(bno,mno,d_o_issue)"\
"VALUES (%s, %s, %s)")
data = (bno,mno,date(YY,MM,DD))
Cursor.execute(Qry,data)
cnx.commit()
Cursor.close()
cnx.close()
print("Record Inserted..............")
except mysql.connector.Error as err:
if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user
name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(err) 33
LIBRARY MANAGEMENT SYSTEM

cnx.close()

def returnBook():
try:
cnx =
connection.MySQLConnection(user='root',
password=‘h’,
host='127.0.0.1', database='Library')
Cursor = cnx.cursor()
bno=input("Enter Book Code of Book to be returned to
the Library : ")
Mno=input("Enter Member Code of Member who is
returning Book : ") retDate=date.today()
Qry =("""Update Issue set d_o_ret= %s WHERE BNO = %s
and Mno= %s """)
rec=(retDate,bno,Mno)
Cursor.execute(Qry,rec)

# Make sure data is committed to the database

cnx.commit()
Cursor.close()
cnx.close()
print(Cursor.r
owcount,"Recor
d(s) Deleted
Successfully..
...........")
except
mysql.connecto
r.Error as
err:
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or
password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(err)
cnx.close()

34
LIBRARY MANAGEMENT SYSTEM

#PYTHON MODULE MEMBER

import mysql.connector
from mysql.connector import errorcode
from datetime import date, datetime, timedelta
from mysql.connector import (connection)
import os
def clrscreen():
print('\n' *5)
def display():
try:
os.system(
'cls')
cnx =
connection.MyS
QLConnection(u
ser='root',
password='h’,

host='localhost',
database='LIbrary') Cursor =
cnx.cursor()
query = ("SELECT * FROM Member")
Cursor.execute(query)
for (Mno,Mname,MOB,DOP,ADR) in Cursor:
print("=============================================
=================")
print("Member Code : ",Mno)
print("Member Name : ",Mname)
print("Mobile No.of Member : ",MOB)
print("Date of Membership : ",DOP)
print("Address : ",ADR)
print("========================
=====================
==================")
Cursor.clo
se()
cnx.close()
print("You
have done
it!!!!!!")
except
mysql.connecto
r.Error as
err:
if err.errno == 35
errorcode.ER_ACCESS_DENIED_ERROR: print("Something
is wrong with your user name or password")
LIBRARY MANAGEMENT SYSTEM

def insertMember():
try:
cnx =
connection.MySQLCon
nection(user='root'
,
password=‘h’,
host='127.0.0.1', database='Library')
Cursor = cnx.cursor()
mno=input("Enter Member Code : ")
mname=input("Enter Member Name : ")
mob=input("Enter Member Mobile No. :
")
print("Enter Date of Membership (Date/MOnth and Year
seperately: ")
DD=int(input("Enter Date : "))
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),addr)
Cursor.execute(Qry,data)

# Make sure data is committed to the


database

cnx.commit()
Cursor.close()
cnx.close()
print("Record
Inserted......
........")
except mysql.connector.Error as err:
if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user
name or password")
elif err.errno ==
errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(err)
cnx.close()
36
LIBRARY MANAGEMENT SYSTEM

def deleteMember():
try:
cnx =
connection.MySQLConnection(user='root',
password=‘h’,
host='127.0.0.1', database='Library')
Cursor = cnx.cursor()
mno=input("Enter Member Code to be deleted from the
Library : ")
Qry =("""DELETE FROM Member WHERE MNO = %s""")
del_rec=(mno,)
Cursor.execute(Qry,del_rec)
# Make sure data is
committed to the database
cnx.commit()
Cursor.close()
cnx.close()
print(Cursor.r
owcount,"Recor
d(s) Deleted
Successfully..
...........")
except
mysql.connecto
r.Error as
err:
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or
password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(err)
cnx.close()

37
LIBRARY MANAGEMENT SYSTEM

def SearchMember():
try:
cnx =
connection.MySQLConnection(user='root',
password=‘h’,
host='127.0.0.1', database='Library')
Cursor = cnx.cursor()
mnm=input("Enter Book Name to be Searched from the
Library : ")
query = ("SELECT * FROM Member where MName = %s ")
rec_srch=(mnm,)
Cursor.execute(query,rec_srch)
Rec_count=0
for (Mno,Mname,MOB,DOP,ADR) in Cursor:
print("=============================================
=================")
print("Member Code : ",Mno)
print("Member Name : ",Mname)
print("Mobile No.of Member : ",MOB)
print("Date of Membership : ",DOP)
print("Address : ",ADR)
print("=============================
================
==================")
if Rec_count%2==0:
input("Press any key to continue")
clrscreen()
print(Rec_count, "Record(s)
found")

# Make sure data is committed to


the database

cnx.commit()
Cursor.close()
cnx.close()
except
mysql.connecto
r.Error as
err:
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or
password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else: 38
print(err)
cnx.close()
LIBRARY MANAGEMENT SYSTEM

6. Output

LIBRARY MANAGEMENT

39
LIBRARY MANAGEMENT SYSTEM

BOOK RECORD MANAGEMENT

40
LIBRARY MANAGEMENT SYSTEM

ADD A NEW BOOK

41
LIBRARY MANAGEMENT SYSTEM

UPDATE AN EXISTING BOOK

42
LIBRARY MANAGEMENT SYSTEM

MEMBER MANAGEMENT

43
LIBRARY MANAGEMENT SYSTEM

ADD A NEW MEMBER

44
LIBRARY MANAGEMENT SYSTEM

DISPLAY MEMBER

45
LIBRARY MANAGEMENT SYSTEM

ISSUE RECORD

ISSUE BOOK TO A MEMBER

46
LIBRARY MANAGEMENT SYSTEM

DISPLAY ISSUE RECORD

47
LIBRARY MANAGEMENT SYSTEM

RETURN BOOK

48
LIBRARY MANAGEMENT SYSTEM

RETURN TO MAIN MENU

EXIT FROM LIBRARY MANAGEMENT

49
LIBRARY MANAGEMENT SYSTEM

7. User Manual

1. How to Install Software:

Hardware Requirement-
♦ Intel Pentium/Celeron or similar processor based PC at Client/Server end.

♦ 128 MB RAM and 4GB HDD space (for Database) is desirable.

♦ Standard I/O devices like Keyboard and Mouse etc.

♦ Printer is needed for hard-copy reports.

♦ Local Area Network(LAN) is required for Client-Server Installation

Software Requirement-
♦ Windows 2000/XP OS is desirable.

♦ NetBeans Ver 5.1 or higher should be installed with JDK and JVM.

♦ MySQL Ver 6.1 with Library Database must be present at machine.

Database Installation-

The software project is distributed with a backup copy of a Database named LIBRARY
with required tables. Some dummy records are present in the tables for testing
purposes, which can be deleted before inserting real data. The project is shipped with
manav.SQL file which installs a database and tables in the computer system.

Note: The PC must have MySQL server with user (root) and password (h) . If root
password is any other password, it can be changed by running MySQL Server Instance
Configure Wizard.

Start Program  MySQL MySQL Server MySQL Server Instance Config Wizard

50
LIBRARY MANAGEMENT SYSTEM

Provide the current password of root and new password as “h” , this will change the
root password.

To install a MySQL database from a dump file ( manav.sql) , simply follow the
following steps.
Step 1: Copy the manav.sql file in C:\Program files\Mysql\MySql server 5.1\
Bin
folder.
Step 2: Open MySQL and type the following command to create the database named
travel agency.
mysql> create database library;
Step 3: Open Command Window (Start Run  cmd)
Step 4: Go to the following folder using the CD command of DOS.
C:\Program files\Mysql\MySql server 5.1\Bin>
Step 5: type the following command on above prompt -
C:….\bin> mysql -u root -pmanav library <manav.sql
This will create a library database with required tables.

51
LIBRARY MANAGEMENT SYSTEM

52

You might also like