You are on page 1of 35

ACKNOWLEDGEMENT

I would like to express my special thanks of


gratitude to my Computer Science teacher Mr.
Sunil Sir as well as our principal Dr. Sarita
Sirohi who gave me the golden opportunity to do
this wonderful project on the topic “Library
Management
System”.
Secondly, I would also like to thank my parent
and friends who helped me a lot in finalizing this
project within the limited time frame.
Finally, I would like to thank the CBSE board
for giving me this great opportunity to do this
project.

Page.2
CERTIFICATE
This is to certify that Prins Kumar of Class XII
has completed his Computer Science project
titled Library Management System under the
guidance of Mr. Sunil Sir for the academic year
2023-24. The certified student has been
dedicated throughout his research and completed
his work before the given deadline without
missing any important details from the project. It
is also certified that this project is the individual
work of the student and can be submitted for
evaluation.

Teacher's Signature

Page.3
LIBRARY
MANAGEMENT
SYSTEM
NAME – PRINS
KUMAR

CLASS – 12

A ROLL NO -

28
Page.4
Pog
e
Project Anolysis

Functions ond
Modules

O7

Detoiled Des«ription
«7
¥our«e Code

Outputs oxd Tobles

Bibliogrophy

Remorbs

Page.
5
@ROECT
ț ANALY¥I¥
Our application program is specially
designed for the public library
named Ÿ- “READING C‹ü
MMUNITY.”

They lend books to readers who have


subscribed with the library.

We have tried to maximise the efficiency and


strived for
customer and user ease as well as satisfaction.

We have thoroughly examined the needs of the library


and
after the analysis, we have constructed the program.

We have used PYTHON and MYSQL as our


platform to carry out this task.

Page.
6
FUNCTION¥ AND
MODULE¥

Modules:

import mysql.connector:

By importing this package, we are able to establish


the connection between SQL and Python.

Page.7
FUNGTIONS:

connect():

This function establishes connection between Python


and MySQL

cursor():

It is a special control structure that facilitates the


row-by- row processing of records in the result set.
The Syntax is:
<cursor object>=<connection object>.cursor()

execute():

This function is used to execute the sql query and


retrieve
records using python.
The syntax is:
<cursor object>.execute(<sqI query string>)

def():

A function is a block of code which only runs when it


is
called.
Page.8
fetchall():

This function will return all the rows from the result
set in the form of a tuple containing the records.

fetchone():

This Function will return one row from the result


set in the form of a tuple containing the records.

commit():

This function provides changes in the database


physically.

Page.9
The
1OURCE CODE

MForYSQL
create database library
app;
use Iibrary_app;
create table books
(bname varchar(50),
author varchar(50),
bcode varchar(50),
total int(50),
subject
varchar(50));

create table issue


(name
varchar(50), regno
varchar(50), bcode
int(50),
issue date
varchar(50));

create table
return (name
Page.11
varchar(50), regno
For P
thon:
import mysql.connector as a
con=a.connect(host ocalhost’,user=’root’,passwd='9586’,data
base='Iibrary app’)
def addbooI‹():
bn=input("Enter Book Name: ")
ba=input("Enter Author's Name: ”)
c=int(input("Enter Book Code: ”))
t=int(input(”Total Books: ”))
s=input("Enter Subject: ")
data=(bn,ba,c,t,s)
sqI=1nsert into books values(0/os,O/os,O/os,%s,O/os);'
c=con.cursor()
c.execute(sqI,data)
con.commit()
print(”\n\n\n\nBook Added Successfully..........\n\n\n\n”)
wait = input('\n\n\nPress enter to continue.....\n\n\n\n\n\
n’)
main()
def issueb():
n=input("Enter Student Name: ”)
r--int(input("Enter Reg No.: "))
co=int(input(”Enter Book Code:
”)) nput("Enter Date: ”)
El= insert into issue values (Oos,Oos,Oos,
data=(n,r,co,d)
c=con.cursor() %s);"
c.execute(a,data)
con.commit()
print(”\n\n\n\nBook issued successfully to: ",n)
wait = input('\n\n\nPress enter to continue.....\n\n\n\n\n\
n’)
bookup(co,-1)
main()

Page.12
def returnb():
n=input("Enter Student Name:
r=int(input("Enter Reg No.: "))
co=int(input(”Enter Book Code:
d=input("Enter Date:
"))
tO $tO
")
a = insert,co,d)
data=(n,r into return_ values(%tS o S
c=con.cursor()
os);”
c.execute(a,data)
con.commit()
print("Book returned by: ",n)
wait = input('\n\n\nPress enter to continue.....\n\n\n\n\
n\n
bookup(co,1)
main()
def
booI‹up(co,u):
a="seIect
total from
books
where
bcode=%s;
data=(co,)
c=con.cursor
()
c.execute(a,d
ata)
myresuIt=c.f
etchone()
t=myresuIt[0
]+u
sqI="update
books set
totaI=%s
where
bcode=%s;
d=(t,co)
c.execute(sq
I,d)
con.commit(
)
wait = input('\n\n\nPress enter to continue.....\n\n\n\n\
n\n main()
Page.13
del d booI‹():
def dispbool‹():
a=”seIect * from books;"
c=con.cursor()
c.execute(a)
myresuIt=c.fetchaII()
for i in myresult:
print(”Book name: ",i[0])
print("Author: ",i[1])
print(”Book code: ",i[2])
print(”Total:",i[3])
print(”Subject:",i[4])
print('\n\n’)
wai nput('\n\n\
nPress enter to
continue.....\n\n\n\n\n\n\n\n\n\n\n\n')
main()
def report issued
booI‹s():
a=”seIect * from issue;
c=con.cursor()
c.execute(a)
myresuIt=c.fetchaII()
for i in myresult:
print(myresuIt)
wait = input('\n\n\nPress
enter to
continue.....\n\n\n\n\n\n\
n\n’)
main()

def report return


booI‹s():
a=”seIect * from return_;
c=con.cursor()
c.execute(a)
myresuIt=c.fetchaII()
for i in myresult:
print(myresuIt)
Page.14
wai nput('\n\n\
nPress enter to
def
main():
print(""”
L
I

M
\n\n\n
E
I I I)

N
choice=input("Enter Task
No:......")
T
print('\n\n\n\n\n\n\n’)
if choice==’1".
A
report_issued books()
elif choice==’2“.
P
report return books()
elif choice==’3“. Page.15
P
main()
else:
print("Please try again........\n\n\n\n\n\n\n\n\n")
main()
elif(
choice=='7'):
day
hea n\n\n\n\n\n\n\n\n\n\n\n\n\n\n’)
else:
print("Please try again........\n\n\n\n\n\n\n\n\n\n\n\
main(
n")
)
main()

Page.16
OUYPUTA1ND
TABLE¥
Ë OUTPUTS:
1.) Add a
Bool‹:

Page.17
2.) Issue a
Book:
A P P i i c A z l o x

E n c e z S e p No . : 501
Eacez Book Code

Book issued successfully co:

M A N A G E B E A P P L I [ A T I O W
N T

Page.18
2.) Issue a
Book:
A P P i i c A z l o x

E n c e z S e p No . : 501
Eacez Book Code

Book issued successfully co:

M A N A G E B E A P P L I [ A T I O W
N T

Page.18
3. Return of Book:

£ I B R A R Y M A M A G E H E 0 T A P P c I C A T I O N

i. am eo‹nx

Enter Student Wmme: Akshdy


Ezt<ez' Req No . I S O2
Ezt*e= B o o k C o d e › IO S
Rnzor Dan:: l9-01-BO2l
Dook iecuxneB by: AAsAay

L I B R A R Y M A N A 0 £ x r N r A P P L I O A T I O N

1. ADD BODK
2. I ii 5 UE OF 13OOK
0 . RETDRN OF EOOE
4 . DELETE BOOK
5 . DH PLAY BOORS
6 . RE PORT MENU
7 . E X Z Z PRCGRRH

E n c e x 5 t u d e n s flame: Aj ay
E n c e x Req No . : 501
Encer BinoF Code : 1 o9
Enter Dase: 21-01-2021
Dook reLurnca by: Ajay

Pxes s enbex to
continue . . . . .

Page.19
4.) Delete a
Book:
A P P L I C * T t O
N

5.) Display
Books: A P P L I C L T I O N

Page.20
Boo lr nane : Wings o I Fixe
Author: A.P.J. Abdul
¥alam Book code: 103
5
5uDjrct: 5elZ Rzlienco

Book name: Onc Arranged


Hurder
Authnz: Clietan Bhaqat
9ook codc: 101
Total: 5
5uDjocs: Thriller

Book name : cnanazYa


rices i Authoz : hshwini Paz
a s h a x Rook code: lD6
lotal: 1
SVj*cs: Selfhclg book

Book name: Thinr & win lire


Dhoni Author: 5[urti Sahare
Book code: lD7
Total: 6
Subject: Hotivmtion

Book name : Riennut Fear : Bhaqat


Singh
Authoz: Kuldeep Nayyar
Boox coae: 105

Subject: Biography

Book nmmm: The Inviziblz


Hen Authoz: H.G.hells
3ook code: 108
Total: 9
Subject: Fiction

Book naree : Ha xzy Post ez se


x i es
Aathor: J.K.Rowling
Book code: llD
local: 9
5:ibjact:
Drama,Hysrrzy

Press enter to
continue.....

Page21
6. Report Menu:

L I E R A R T H A N A G E R E N T A P P L I C A I I 0 N

2. ISSDI OF BOOK
3 . RfiZURh OF

6. R£PORJ NENU
7. EZII PROGRAM

R E F 0 R Z H E N U

2 . RZ3OžtPED BOORg
3 . GO B7tCK 7O HAIN NEN0

E n e e z Z a o k No : . . . . . .

Entzz Fask No:......1

('Ajay', '501', 107, '10-01-20211


('A¥shay', '502', 105, '15-01-2021')
l'Ranvooz', 'ODS', l0Q, '19-01-2021')
('John', 'SO ', 1D1, '21-41-2021')
('ADhi', '505', 108, '2€-01-2021')
('Pracit', 'bO6', 102, 'J9-O]—202]')
( 'Nee xay ' , ' 507 ’ , 106, ' 3s-o1-3021 ' )
('Rohit', '508'. 104. '02-02-2021')
('Sanjay', 'B09', 101, '06-02-2021')
('Aiia, 'sio•, iio, 'oo—oz-zozr)
(’Weha', '511', 109, '1 -D2-203l')

Page.22
R E P 0 R Z

502’, 105 19 01 2021


'Soi', ron, 'zi-oi-vozi')
504 101, 2B Ql 20]l
'503', 104, '31-01-2021')
5O6 IO] 05
02 ]021

R E P Q R I

3 . C-O BACR ZO NAZn HEHO

H A if A G E H E n T A P P L Z C n Z Z O tr

DELRTE ROO¥
DI4PLAY DOG
6. REPORT NENO
EXII PROGRAM

Page.23
7.) Exit
Program:
L I B R A R A P P L I EA Æ I
F OÆ

Page.24
& TABLES:

1.) Select * from


Bool‹s:

Page.25
2)
Select*fromlssue

Page.26
3.) Se 1 ect ^ from Retu rn

Page.27
BIBLIOGRAPHY
1) www.google.com
2) Chat GPT
3) Computer Science with Python Class 12
Sumita Arora
4) https://www.github.com
5) https://slideshare.in
6) https://cbsepython.in

Page.28

You might also like