Book Store Management System
Book Store Management System
ON
FOR
By
Roll no.:-
CLASS – XII
Page 1
Book Store Management System
BIODATA
NAME- Archita Mohanty
CLASS- XII
ROLL NO
SUBJECT- Computer science
Page 2
Book Store Management System
ACKNOWLEDGEMENT
We have immense pleasure in presenting the report for our project
project.
invaluable suggestions. They were the one who never let our morale
down & always supported us through our thick & thin. They were the
project.
We would also like to thank all the staff members for their
We are also thankful to all the students for giving us their useful
Page 3
Book Store Management System
DECLARATION
I “ Archita Mohanty ” of class-XII, bearing roll no:
Of Buxi Jagabandhu English Medium School-II, Satyabhamapur. I
am Submitting this copy of computer science project as evidence of
my work in computer laboratory.
Class- XII
Roll No-
Page 4
Book Store Management System
BONAFIDE CERTIFICATE
THIS IS TO CERTIFY THAT “ Archita Mohanty ” OF CLASS – XII
HAS SUCCESSFULLY PREPARED THE PROJECT ON “COLLEGE
MANAGEMENT SYSTEM” FOR AISSCE UNDER THE GUIDANCE
MR. ANSUMAN SWAIN’S IN THE COMPUTER SCIENCE
DEPARTMENT OF BUXIJAGABANDHU ENGLISH MEDIUM
SCHOOL-II, SATYABHAMAPUR FOR THE ACADEMIC SESSION
2023-24.
Page 5
Book Store Management System
INDEX
SL NO TOPIC NAME PAGE NO
1. Introduction 7
4. Python coding 10
5. Output 18
6. Bibliography 21
Page 6
Book Store Management System
INTRODUCTION
Page 7
Book Store Management System
Drawbacks:
Page 8
Book Store Management System
Hardware required:
1.Processor:Intel core i3 10th gen
2.Ram: 4GB or More
3.Hard disk: 1TB or More
4.Monitor:14inch
5.keyboard:For typing purpose
6.Mouse: For pointer
Software required:
1.Python version: 3.8 or 3.9
2.Ms word for presentation of output
Page 9
Book Store Management System
PYTHON CODING
#https://cbsepython.in
importmysql.connector
mydb=mysql.connector.connect (host="localhost", user="root",password="admin")
#CREATING DATABASE AND TABLE
mycursor=mydb.cursor()
mycursor.execute("create database if not exists store")
mycursor.execute("use store")
mycursor.execute("create table if not exists signup(username varchar(20),password
varchar(20))")
while True:
print("""1:Signup
2:Login""")
ch=int(input("SIGNUP/LOGIN(1,2):"))
#SIGNUP
if ch==1:
username=input("USERNAME:")
pw=input("PASSWORD:")
mycursor.execute("insert into signup values('"+username+"','"+pw+"')")
mydb.commit()
#LOGIN
if ch==2:
username=input("USERNAME:")
mycursor.execute("select username from signup where username='"+username+"'")
pot=mycursor.fetchone()
if pot is not None:
print("VALID USERNAME!!!!!!")
pw=input("PASSWORD:")
mycursor.execute("select password from signup where password='"+pw+"'")
a=mycursor.fetchone()
if a is not None:
print("""+++++++++++++++++++++++
+++LOGIN SUCCESSFULL+++
Page 10
Book Store Management System
+++++++++++++++++++++++""")
print("""=======================================================
===============
++++++++++++++++++++++++++ MY BOOK STORE ++++++++++++++++++
+++++++
=============================================================
=============""")
mycursor.execute("create table if not exists Available_Books(BookName
varchar(30) primary key,Genre varchar(20),Quantity int(3),Author
varchar(20),Publication varchar(30),Price int(4))")
mycursor.execute("create table if not exists Sell_rec(CustomerName
varchar(20),PhoneNumber char(10) unique key, BookName varchar(30),Quantity
int(100),Price int(4),foreign key (BookName) references
Available_Books(BookName))")
mycursor.execute("create table if not exists Staff_details(Name varchar(30), Gender
varchar(10),Age int(3), PhoneNumber char(10) unique key , Address varchar(40))")
mydb.commit()
while(True):
print("""1:Add Books
2:Delete Books
3:Search Books
4:Staff Details
5:Sell Record
6:Available Books
7:Total Income after the Latest Reset
8:Exit""")
a=int(input("Enter your choice:"))
#ADD BOOKS
if a==1:
print("All information prompted are mandatory to be filled")
book=str(input("Enter Book Name:"))
Page 11
Book Store Management System
genre=str(input("Genre:"))
quantity=int(input("Enter quantity:"))
author=str(input("Enter author name:"))
publication=str(input("Enter publication house:"))
price=int(input("Enter the price:"))
mycursor.execute("select * from Available_Books where bookname='"+book+"'")
row=mycursor.fetchone()
if row is not None:
mycursor.execute("update Available_Books set quantity=quantity+'"+str(quantity)
+"' where bookname='"+book+"'")
mydb.commit()
print("""++++++++++++++++++++++
++SUCCESSFULLY ADDED++
++++++++++++++++++++++""")
else:
mycursor.execute("insert into
Available_Books(bookname,genre,quantity,author,publication,price)
values('"+book+"','"+genre+"','"+str(quantity)
+"','"+author+"','"+publication+"','"+str(price)+"')")
mydb.commit()
print("""++++++++++++++++++++++
++SUCCESSFULLY ADDED++
++++++++++++++++++++++""")
#DELETE BOOKS
if a==2:
print("AVAILABLE BOOKS...")
mycursor.execute("select * from Available_Books ")
for x in mycursor:
print(x)
cusname=str(input("Enter customer name:"))
phno=int(input("Enter phone number:"))
book=str(input("Enter Book Name:"))
price=int(input("Enter the price:"))
Page 12
Book Store Management System
n=int(input("Enter quantity:"))
mycursor.execute("select quantity from available_books where
bookname='"+book+"'")
lk=mycursor.fetchone()
if max(lk)<n:
print(n,"Books are not available!!!!")
else:
mycursor.execute("select bookname from available_books where
bookname='"+book+"'")
log=mycursor.fetchone()
if log is not None:
mycursor.execute("insert into Sell_rec values('"+cusname+"','"+str(phno)
+"','"+book+"','"+str(n)+"','"+str(price)+"')")
mycursor.execute("update Available_Books set quantity=quantity-'"+str(n)+"'
where BookName='"+book+"'")
mydb.commit()
print("""++++++++++++++++++++++
++BOOK HAS BEEN SOLD++
++++++++++++++++++++++""")
else:
print("BOOK IS NOT AVAILABLE!!!!!!!")
#SEARCH BOOKS ON THE BASIS OF GIVEN OPTIONS
if a==3:
print("""1:Search by name
2:Search by genre
3:Search by author""")
l=int(input("Search by?:"))
#BY BOOKNAME
if l==1:
o=input("Enter Book to search:")
mycursor.execute("select bookname from available_books where
bookname='"+o+"'")
tree=mycursor.fetchone()
Page 13
Book Store Management System
if tree!=None:
print("""++++++++++++++++++++
++BOOK IS IN STOCK++
++++++++++++++++++++""")
else:
print("BOOK IS NOT IN STOCK!!!!!!!")
#BY GENRE
if l==2:
g=input("Enter genre to search:")
mycursor.execute("select genre from available_books where genre='"+g+"'")
poll=mycursor.fetchall()
if poll is not None:
print("""++++++++++++++++++++
++BOOK IS IN STOCK++
++++++++++++++++++++""")
mycursor.execute("select * from available_books where genre='"+g+"'")
for y in mycursor:
print(y)
else:
print("BOOKS OF SUCH GENRE ARE NOT AVAILABLE!!!!!!!!!")
#BY AUTHOR NAME
if l==3:
au=input("Enter author to search:")
mycursor.execute("select author from available_books where author='"+au+"'")
home=mycursor.fetchall()
if home is not None:
print("""++++++++++++++++++++
++BOOK IS IN STOCK++
++++++++++++++++++++""")
mycursor.execute("select * from available_books where author='"+au+"'")
for z in mycursor:
print(z)
else:
Page 14
Book Store Management System
Page 15
Book Store Management System
Page 16
Book Store Management System
for v in mycursor:
print(v)
#TOTAL INCOME AFTER LATEST UPDATE
if a==7:
mycursor.execute("select sum(price) from sell_rec")
for x in mycursor:
print(x)
#EXIT
if a==8:
print(exit)
#LOGIN ELSE PART
if a==9:
print("""++++++++++++++++++++++
++INCORRECT PASSWORD++
++++++++++++++++++++++""")
else:
print("""++++++++++++++++++++
++INVALID USERNAME++
++++++++++++++++++++""")
else:
break
Page 17
Book Store Management System
OUTPUT
1:Signup
2:Login
SIGNUP/LOGIN(1,2):1
USERNAME:"jitendra"
PASSWORD:"12345"
1:Signup
2:Login
SIGNUP/LOGIN(1,2):2
USERNAME:"jitendra"
VALID USERNAME!!!!!!
PASSWORD:"12345"
+++++++++++++++++++++++
+++LOGIN SUCCESSFULL+++
+++++++++++++++++++++++
=========================================================
=============
++++++++++++++++++++++++++ MY BOOK STORE +++++++++++++++
++++++++++
=========================================================
=================
1:Add Books
2:Delete Books
3:Search Books
4:Staff Details
5:Sell Record
6:Available Books
7:Total Income after the Latest Reset
8:Exit
Enter your choice:1
All information prompted are mandatory to be filled
Enter Book Name:"Computer Science with Python"
Page 18
Book Store Management System
Enter quantity:10
Enter author name:"cbsepython"
Enter publication name:"cbsepython"
Enter the price:320
++++++++++++++++++++++
++SUCCESSFULLY ADDED++
++++++++++++++++++++++
1:Add Books
2:Delete Books
3:Search Books
4:Staff Details
5:Sell Record
6:Available Books
7:Total Income after the Latest Reset
8:Exit
Enter your choice:2
Enter Book Name:"Ncert Chemistry Part-1 "
Enter quantity:1
Enter author Name: “Ncert”
Enter publication name:"cbse"
Enter the price:200
++++++++++++++++++++++
++SUCCESSFULLY DELETED++
++++++++++++++++++++++
1:Add Books
2:Delete Books
3:Search Books
4:Staff Details
5:Sell Record
6:Available Books
7:Total Income after the Latest Reset
8:Exit
Enter your choice:3
Page 19
Book Store Management System
Page 20
Book Store Management System
BIBILOGRAPHY
Page 21
Book Store Management System
Page 22