Computer Science Investigatory Project: Topic: Submitted By: Class: School: Place
Computer Science Investigatory Project: Topic: Submitted By: Class: School: Place
INVESTIGATORY PROJECT
Page 4 of 26
INTRODUCTION :
LMS (Library Management System)is also called an automated
library system. It is defined as software that has been established to
manage basic housekeeping function of a library.
The electronic management via the software is essential to track
information like issue date, due date who has borrowed any book
etc. The System is developed and designed with an aim to facilitate
efficient management to the schools to manage a modern library
with accurate data management. The software is intended to reduce
the manual work to manage library functions which have various
features.
Page 5 of 26
Hardware Requirements :
Page 6 of 26
Software Requirements:
❖ Windows OS
❖ IDLE (Python 3.7 32 bit
❖ MYSQL workbench
❖ Python-mysql connector (mysql.connector module)
Modules:
Module is a file that contains code to perform a specific task. A
module may contain variables, functions, classes, etc...
Module used in this project is:
import mysql.connecter:
By importing this package, we are able to establish the connection
between SQL and Python.
Functions:
A function is a set of instructions defined under a particular name,
which once written can be called whenever required. Functions
can be categorized into two types:
• Built-in
• User-defined
I have listed the used functions, their purpose and syntax in
this section. connect():
This function establishes connection between Python and MySQL.
cursor():
It is a special control structure that facilitates the row-by-row
Page 7 of 26
DETAILED DESCRIPTION
Page 8 of 26
1. The table books contain the following columns:
a. bname
b. author
c. bcode
d. total
e. subject
SOURCE CODE
For MySQL:
Create database library_app;
Use library_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
varchar(50), regno
varchar(50), bcode
int(50),
return_date varchar(50));
FOR PYTHON:
Import mysql.connector as a
Con= a.connector(host=’localhost’,user=’root’,password=’
9586’,database=’libarary_app’) def
addbook():
bn=input(“Enter Book Name”)
bn=input(“enter author’s Name:”)
t=int(input(“Total books: ”)) s=input(“Enter
subject: ”)
Page 10 of 26
data=(bn,ba,c,t,s)
sql=,insert into books values( %s,%s,%s,%s,
%s); c=con.cursor() c.execute() 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\n’) main()
def issueb():
n= input(“Enter Student Name:”)
r= int(input(“Enter reg No. : “)
co=int(input(“Enter Book
Code :”) d=input(“Enter Date:”)
a=”insert into issue values(%s,%s,%s,%s,
%s); data=(n,r,co,d) c=con.cursor()
c.execute(a,data)
con.commit()
print(“\n\n\n\nBook issused successfully to : “,n)
wait=input(‘\n\n\nPress enter to
continue… \n\n\n\n\n\n’)
bookup(co,-1)
main()
def dispbook():
a=”select*frombooks,”
c=con.cursor()
c.execute(a)
myresult=c.fetchall() 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+)
wait=input(‘\n\n\nPress enter to
continue….. \n\n\n\n\n\n\n\n\n\n’)
main()
def report_issued_books();
a=”select*from issue;”
c=con.cursor()
c.execute(a)
myresult=c.fetchall()
for I in myresult:
print(myresult)
wait=input(‘\n\n\nPress enter to
continue….\n\n\n\n\n\n\n\n’) main()
def
report_return_books():
a=”select*from return_;”
c=con.cursor()
c.execute(a)
myresult=c.fetchall()
for i in myresult:
print(myresult)
wait=input(‘\n\n\nPress enter to
continue….\n\n\n\n\n\n\n\n\n\n\n\n’)
main()
def return()
n=input(“Enter student name: “)
r=int(input(“Enter reg no.: “)) co=
int(input(“Enter Book Code: “))
d=input(‘Enter Date: “)
a=”insert into return_values(%s,%s,%s,
%s);” data=(n,r,co,d) c=con.cursor()
c.execute(a,data)
con.commit()
print(“book returned by: “,n) wait=input(‘\n\n\nPress
enter to continue….\n\n\n\n\n’) main()
def bookup(co,u):
a=”select total from books where bcode=%s;
” data = (co,) c=con.cursor()
c.execute(a,data)
myresult=c.fetchone()
t=myresult[0]+u
sql=”update books set total=%s where bcode=%s;”
d=(t,co)
c.execute(sql,d)
con.commit()
wait= input(‘\n\n\nPress enter to continue…..\n\n\n\n\n\n’)
main()
def dbook():
ac=int(input(“enter book code:”))
a=”delete from books where bcode=%s;”
data=(ac,)
c=con.cursor()
c.execute(a,dat)
con.commit()
print(“Book deleted succesfully’) wait=input(‘\
n\n\nPress enter to
continue…..\n\n\n\n\n\n\n\n\n\n\n\n’) main()
def main():
print("""LIBRARY MANAGEMENT APPLICATION
1.ADD BOOK
2. ISSUE OF BOOK
3. RETURN OF BOOK
4. DELETE BOOK
5. DISPLAY BOOKS
6. REPORT MENU
7. EXIT PROGRAM
""") choice=input("enter Task
No: .... ") print('\n\n\n\n\n\n\n')
if(choice=='1'):
addbook()
elif(choice=='2'):
issueb()
elif(choice=='3'):
returnb()
elif(choice=='4'):
dbook()
elif(choice=='5'):
dispbook()
elif(choice=='6'):
print('''REPORT MENU
1.ISSUED BOOKS
2. RETURNED BOOKS
3. GO BACK TO MAIN MENU
\n\n\n
''')
choice=input("Enter Task No: ....
") print('\n\n\n\n\n\n\n') if
choice=='1':
report_issued_books()
elif choice=='2':
report_return_books()
elif choice=='3':
main()
else:
print("Please try again. .... \n\n\n\n\n\n\n\n\n")
main()
elif(choice=='7'):
print('\n\n\n\n\n\n\n\n\n\n\n\nThank you and have a
great day ahead ..... \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\n")
main()
main()
Page 17 of 26
2)Issue a Book:
Page 18 of 26
3)Return a Book:
Page 19 of 26
4)Delete a Book:
5)Display books:
Page 20 of 26
Page 21 of 26
6. Report Menu:
Page 22 of 26
7. Exit Program:
Page 23 of 26
➢ TABLES:
Page 25 of 26
BIBLIOGRAPHY:
• www.byjus.com
• www.vedantu.com
• www.wikipidea.com