BOOK STORE MANAGEMENT SYSTEM
BOOK STORE MANAGEMENT SYSTEM
BOOK STORE MANAGEMENT SYSTEM
- Made By:
- Atharv Tiwari
- Swasti Singhal
- Suhani Gupta
1
INDEX
1. Certificate
2. Acknowledgements
3. Declaration
4. Aim
5. Coding
6. Output Screenshots
7. Hardware Requirements
8. Bibliography
2
DECLARATION
- Atharv Tiwari
- Swasti Singhal
- Suhani Gupta
3
AIM
Store Management
4
Explanation:
This is a Python program that creates a simple bookstore management system. The program allows
users to sign up or login, add books to the store, delete books from the store, search for books by various
criteria, view staff details, record sales, and view the total income after the latest reset. The program uses
When the program is run, it first creates a connection to the MySQL server running on the local
machine, using the root user and the password “admin”. It then creates a database called “store” (if it
doesn’t already exist) and uses it. It creates a table called “signup” with columns for “username” and
The program then enters a loop that presents the user with a choice between signing up and logging
in. If the user chooses to sign up, they are prompted to enter a username and password, which are then
stored in the “signup” table. If the user chooses to log in, they are prompted to enter a username. If the
username is found in the “signup” table, the program prompts the user to enter their password. If the
password is correct, the user is presented with a menu of options for managing the bookstore.
5
Add Books: The user is prompted to enter information about a new book (name, genre, quantity,
author, publication, and price). If the book is already in the store, the quantity is increased. Otherwise, the
Delete Books: The user is shown a list of available books and prompted to enter information about a
book to delete (name, quantity, customer name, phone number, and price). If the requested quantity of the
book is available, a record of the sale is added to the “Sell_rec” table and the quantity of the book is
Search Books: The user is prompted to choose a search criterion (name, genre, or author) and enter
a search term. The program searches the “Available_Books” table for books matching the search criterion
Staff Details: The user is shown a list of staff details (name, gender, age, phone number, and
Sell Record: The user is shown a list of records of book sales stored in the “Sell_rec” table.
Available Books: The user is shown a list of available books stored in the “Available_Books” table.
Total Income after the Latest Reset: The user is shown the total income from book sales since the
last reset.
6
Exit: The program exits.
Overall, this program provides a basic framework for managing a small bookstore. However, it has
several limitations and potential issues. For example, the program does not include any error handling or
input validation, which could lead to incorrect or invalid data being stored in the database. Additionally, the
program does not include any authentication or authorization mechanisms, so anyone with access to the
7
Source Code:
#https://cbsepython.in
import mysql.connector
mycursor=mydb.cursor()
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:")
mydb.commit()
#LOGIN
elif ch==2:
username=input("USERNAME:")
pot=mycursor.fetchone()
9
print("VALID USERNAME!!!!!!")
pw=input("PASSWORD:")
a=mycursor.fetchone()
if a is not None:
print("""+++++++++++++++++++++++
+++LOGIN SUCCESSFULL+++
+++++++++++++++++++++++""")
print("""==================================================================
====
=========================================================================
=""")
mydb.commit()
10
while(True):
print("""1:Add Books
2:Delete Books
3:Search Books
4:Staff Details
5:Sell Record
6:Available Books
8:Exit""")
#ADD BOOKS
if a==1:
genre=str(input("Genre:"))
quantity=int(input("Enter quantity:"))
11
mycursor.execute("select * from Available_Books where bookname='"+book+"'")
row=mycursor.fetchone()
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
elif a==2:
12
print("AVAILABLE BOOKS...")
for x in mycursor:
print(x)
n=int(input("Enter quantity:"))
lk=mycursor.fetchone()
if max(lk)<n:
else:
log=mycursor.fetchone()
+"','"+book+"','"+str(n)+"','"+str(price)+"')")
13
mycursor.execute("update Available_Books set quantity=quantity-'"+str(n)+"' where
BookName='"+book+"'")
mydb.commit()
print("""++++++++++++++++++++++
++++++++++++++++++++++""")
else:
elif 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:
tree=mycursor.fetchone()
14
if tree!=None:
print("""++++++++++++++++++++
++BOOK IS IN STOCK++
++++++++++++++++++++""")
else:
#BY GENRE
elif l==2:
poll=mycursor.fetchall()
print("""++++++++++++++++++++
++BOOK IS IN STOCK++
++++++++++++++++++++""")
for y in mycursor:
print(y)
else:
15
print("BOOKS OF SUCH GENRE ARE NOT AVAILABLE!!!!!!!!!")
elif l==3:
home=mycursor.fetchall()
print("""++++++++++++++++++++
++BOOK IS IN STOCK++
++++++++++++++++++++""")
for z in mycursor:
print(z)
else:
mydb.commit()
#STAFF DETAILS
elif a==4:
16
print("2:Remove staff")
if ch==1:
fname=str(input("Enter Fullname:"))
gender=str(input("Gender(M/F/O):"))
age=int(input("Age:"))
add=str(input("Address:"))
values('"+fname+"','"+gender+"','"+str(age)+"','"+str(phno)+"','"+add+"')")
print("""+++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++""")
mydb.commit()
#REMOVE STAFF
elif ch==2:
17
mycursor.execute("select name from staff_details where name='"+nm+"'")
toy=mycursor.fetchone()
print("""+++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++""")
mydb.commit()
else:
elif ch==3:
run=mycursor.fetchone()
for t in mycursor:
print(t)
for t in mycursor:
18
print(t)
else:
mydb.commit()
#SELL HISTORY
elif a==5:
if ty==1:
for u in mycursor:
print(u)
if ty==2:
if bb=="Y":
mydb.commit()
elif bb=="N":
19
pass
#AVAILABLE BOOKS
elif a==6:
for v in mycursor:
print(v)
elif a==7:
for x in mycursor:
print(x)
#EXIT
elif a==8:
break
else:
print("""++++++++++++++++++++++
++INCORRECT PASSWORD++
++++++++++++++++++++++""")
20
else:
print("""++++++++++++++++++++
++INVALID USERNAME++
++++++++++++++++++++""")
else:
break
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!!!!!!
21
PASSWORD:"12345"
+++++++++++++++++++++++
+++LOGIN SUCCESSFULL+++
+++++++++++++++++++++++
======================================================================
=========================================================================
1:Add Books
2:Delete Books
3:Search Books
4:Staff Details
5:Sell Record
6:Available Books
8:Exit
22
Genre:"Programming"
Enter quantity:10
++++++++++++++++++++++
++SUCCESSFULLY ADDED++
++++++++++++++++++++++
1:Add Books
2:Delete Books
3:Search Books
4:Staff Details
5:Sell Record
6:Available Books
8:Exit
Explanation:
23
This is a Python program that creates a simple bookstore management system. The program allows
users to sign up or login, add books to the store, delete books from the store, search for books by various
criteria, view staff details, record sales, and view the total income after the latest reset. The program uses
When the program is run, it first creates a connection to the MySQL server running on the local
machine, using the root user and the password “admin”. It then creates a database called “store” (if it
doesn’t already exist) and uses it. It creates a table called “signup” with columns for “username” and
BIBLIOGRAPHY
24
1. Computer science With Python - Class XI By : SumitaArora
2. Website: https://www.w3resource.com
3. https://en.wikipedia.org/wiki/E_(mathematical_constant)
*****************
25