Computer Science Lib
Computer Science Lib
NAME :
GRADE :
ROLL NO :
SUNBEAM SR SEC SCHOOL
BONAFIDE CERTIFICATE
Teacher Principal
*Introduction
*Features
*Software used
.Frontend:Python
.Backend:Mysql
*Advantage and Disadvantage
*Source code and output
*Bibliography
INTRODUCTION
The “Library Management system “ has been
developed to override the problems prevailing in the
practicing manual system.The application is reduced as
much as possible to avoid errors while entering the
data. It also provides error message while entering
invalid data. No formal knowledge is needed for the
user to use this system. Thus , by this all it proves it is
user friendly. Library management system , as
described above , can lead to error free, secure ,
reliable and fast management system.
Note: Both the programs are interfaced with the help of MySQL
connectorwhich acts as a bridge between these programs
ADVANTAGES OF LIBRARY MANAGEMENT
*Fast Process
* Reduces Manual work
* Digital Records of books details ,
*It saves organization resources
*Improved access
*Technical issues
*System upgrades
*Equipment and infrastructures
*Dependency on internet
*User skills
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));
def addbook():
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) sql='insert into books values(%s,%s, %s,%s,%s):'
c=Con.cursor()
c.execute(sql,data)
con.commit()
print("|n\n\n\nBook Added Successfully...n\n\nin")
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: ")
d=input("Enter Date: ")
a="insert into issue values(%s, %s,%s,%s);"
data=(n,r,co,d)
C=Con.cursor()
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\nin')
bookup(co,-i)
main()
def returnb():
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 = t(\n\n\nPress enter to continue.....\n\n\n\n\n\n')
bookup(co,1)
main()
def bookup(co, u):
a="select total from books where bcode=%s;"
data=(co,)
C=Con.Cursor)
c.executela,data)
myresult=c.fetchone()
t=myresult[0]+u ode:"))
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,data)
con.commit()
print("Book deleted successfully")
wait = input(\n\n\nPress enter to
continue.nin\nnn\n\nnnn\n\n)
main()
def dispbook():
a="'select * from books;"
c=Con.cursor()
C.execute(a)
myresult=c.fetchall()
for i in myresult:
print("Book name:",i[O])
print("Author:"i[1]) "Book code:"i[2)
print"Total:",i[3]).
print("Subject:",i[4])
print("\n\n')
wait = input('\n\n\nPress enter to
continue...\n\n\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 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): 2):
print(" REPORT MENU
1. ISSUED BOOKS
2. RETURNED BOOKS
3. GO BACK TO MAIN MENU
\n\n\n
‘’’)