Cs Project
Cs Project
Cs Project
INVESTIGATORY
PROJECT
NAME: SREEJITH
M
CLASS:
XII-C
ROLL NO:
SCHOOL:KENDRIYA VIDYALAYA NO:1,NAVAL
BASE,KOCHI
ACADEMIC YEAR:2022-2023
INDEX
SL.NO TITLE PAGE
NO
1. CERTIFICATE 03
2. ACKNOWLEDGEMENT 04
3. FACE PAGE 05
4. ABSTRACT 06
5. CODING 08
6. OUTPUT 15
7. BIBLIOGRAPHY 18
CERTIFICATE
Name of the institution: KENDRIYA VIDYALAYA NO 1,NAVAL BASE
Place : KOCHI
of this institute in the year 2022-2023 has completed a project work based on C.B.S.E
syllabus in COMPUTER and has given a satisfactory account of it in the report of the
investigatory project work during the year 2022-23.
Teacher-in-charge Principal
Acknowledgement
I sincerely express my gratitude to the Almighty, whose blessings and
guidance has helped me complete my project successfully. I am
extremely thankful to my Computer teacher Mrs. Hema C.N , Kendriya
Vidyalaya No.1 Kochi for giving me timely suggestions and guidance
and supporting me all time so that I could complete my project in time
and also permitting me to use the facilities of the department and for
showing keen interest in the development of this project.
Once again I thank all those who helped me in doing this project.
Project on library
management
Group Members:
Sreejith M
Akshay V.S
Abstract
Coding
import mysql.connector as sq
def connector():
global mydb
global cursor
mydb = sq.connect(user='root', password='',
host='localhost',port=3306, database='lib')
cursor=mydb.cursor()
def menu():
while True:
print("---------------Welcome to Libray
management system------------------")
choice=int(input("""1)NEW Customer
DETAILS\n2)DELETION Customer DETAILS\
n3)UPDATION Customer DETAILS\n4)DISPLAY
Customer DETAILS\n5)Resturn or issue of books\
n6)Exit\nENTER YOU'R CHOICE:"""))
if choice==1:
new_customer()
elif choice==2:
deletion_customer()
elif choice==3:
updation_customer()
elif choice==4:
display_customer()
elif choice==5:
retisu()
elif choice==6:
print("BACK TO MENU")
menu()
else:
print("Wrong Choice>>> TRY AGIAN")
def new_customer():
connector()
if mydb.is_connected():
print("successfully connected")
sl=int(input("Enter admncode : "))
name=input("Enter name : ")
Phone=int(input("Enter phone number : "))
print('succesfully connected')
sl=int(input('Enter admission number to be
deleted'))
cursor.execute(query)
mydb.commit()
mydb.close()
if cursor.rowcount>0:
print('record deleted')
else:
print('no such record')
def updation_customer():
connector()
if mydb.is_connected():
print("successfully connected")
sl=int(input("enter admission number"))
print("enter new data")
name=input("Enter name : ")
Phone=int(input("Enter phone number : "))
else:
print("not connected")
mydb.close()
def retisu():
connector()
if mydb.is_connected():
def display_issue():
query="select * from book_list where
status='available'"
cursor.execute(query)
for(book_id,sl,status,book_name) in cursor:
print('+++++++++++++++++++++++++++
+++++++++')
print("book_id:","\tbook_name:")
print(book_id," \t",book_name)
print("total record",cursor.rowcount)
def return_book(book_id,sl):
no=0
query="update book_list set status='{}',sl={}
where book_id ='{}'".format("available",no,book_id)
query2="update books set book_id={} where
sl={}".format(no,sl)
cursor.execute(query)
cursor.execute(query2)
mydb.commit()
def issue_book(book_id,sl):
query="update book_list set status='{}', sl={}
where book_id={}".format("ISSUE",sl,book_id)
query2="update books set book_id={} where
sl={}".format(book_id,sl)
cursor.execute(query)
cursor.execute(query2)
mydb.commit()
sl=int(input("Enter your sl no:"))
print("1)ISSUE")
print("2)Return")
choice=int(input("Enter the choice"))
if choice==1:
display_issue()
book_id=int(input("Enter the book id"))
issue_book(book_id,sl)
elif choice==2:
book_id=int(input("Enter the book id from the
book"))
return_book(book_id,sl)
menu()
Output
Bibliography
1) www.slideshare.com
2) www.wikipedia.org