0% found this document useful (0 votes)
37 views25 pages

Front Page Certificate Ac

HELL zeus 26 PM IDP LAST CALL JOIN FAST SLOT WASTE LEADS TO PERMANENT BAN FROM T2 SCRIMS to the the linked to the the

Uploaded by

6mikeytoman9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views25 pages

Front Page Certificate Ac

HELL zeus 26 PM IDP LAST CALL JOIN FAST SLOT WASTE LEADS TO PERMANENT BAN FROM T2 SCRIMS to the the linked to the the

Uploaded by

6mikeytoman9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

SDPS INTERNATIONAL SCHOOL

SESSION – 2024-25
SUBJECT –Computer Science (083)

TOPIC - :BOOK SHOP MANAGEMENT SYSTEM

Submitted To: Submitted By :


Shweta Sharma Ruhani Devgon
CERTIFICATE

This is to certify that Mr. Ruhani Devgon of class XII Commerce Roll

No. ________ appearing for the ALL INDIA HIGHER SECONDARY

CERTIFICATE EXAMINATION in the year 2024-25 has successfully

completed this project of “BOOK SHOP MANAGEMENT SYSTEM” in

practical fulfilment of practical work as prescribed by the board.

Internal Examiner’s signature Principal’s signature

External Examiner’s signature School Stamp


ACKNOWLEDGEMENT

I would like to extend my sincere thanks and gratitude to my

Principal Ms. Anjali Nair and my teacher Mrs.Shweta Sharma

for their valuable guidance and support in making this project

successful.

I also express my sincere thanks to all those who help me in

making this project and to the school for providing me with

facilities required to do my project.


INDEX

 Introduction
 System Implementation
 Algorithm
 Flow Chart
 Programming
 Output
 Scope of Project
 Conclusion
 Bibliography
 PYTHON
Python
Python is a popular programming language. It was created by Guido
van Rossum, and released in 1991.

It is used for:

 web development (server-side),


 software development,
 mathematics,
 system scripting.

Uses of Python
 Python can be used on a server to create web applications.
 Python can be used alongside software to create workflows.
 Python can connect to database systems. It can also read and
modify files.
 Python can be used to handle big data and perform complex
mathematics.
 Python can be used for rapid prototyping, or for production-
ready software development.
 MYSQL
MySQL
MySQL is an open source relational database management system
that was originally released in 1995.
MySQL is popular among all databases, and is ranked as the 2nd
most popular database, only slightly trailing Oracle Database. Among
open source databases, MySQL is the most popular database in use
today.

Usesof MySQL
 Elastic Replication - Where an environment requires the number
OS servers to grow and shrink dynamically.
 High Availability - Where sharding is used for write scale-out (in
which each shard maps to a replication group).
 Source-Replica Replication Alternative - Which allows using a
single source server to make it a single point of contention.
Introduction
A Book Shop Management system is basically for management of
incoming and outgoing material from the Book shop. It will reduce
paper work & work load of user. It can be used in any Book Shop for
maintaining database details and their quantities. The features of
Bookshop system are:-
1. Book database management: The details of book like book
title,author’s name, book price and quantityof books can be
maintained.

2. Customer database management: The details of customer like


first name,last name ,email can be maintained.
SYSTEM IMPLEMENTATION

Device Specification:
1. Device Name:- Vansh-PC
2. Processor:- 11th Gen Intel Core i3
3. Installed Ram:- 8.00 GB (7.65 GB usable)
4. System Type:- 64-bit operating system
5. Edition:- Windows 11
6. Pen and Touch:- No pen or touch
7. Manufacturer:- HP
Algorithm
1. Start the program.
2. Display the main menu:
 Add a book
 Update a book
 Sell a book
 List all books
 Add a Customer
 List all Customers
 Quit
3. Add book function:
a) Asks for details of the new book
b) Print Book added successfully!
4. Update BookFunction:
a)Asks for new details of the book.
b)Print Book updated successfully!
5. Sell book function:
a)Get book ID from user
b)input book id = book id on the file
Yes:- Print Sold x copies of the book (ID: y) to customer.
No:- print Insufficient quantity available for sale.

6. List books function: Display all the books


7. Add Customer Function:
a) Input First Name
b) Input Last Name
c) Input Email id
d) Print Customer added successfully!
8. List Customer function: Display all the customerswith details
9. Exit Function: Exit the program
Flowchart
PROGRAMMING
import mysql.connector

# Connecting python with MySQL database


db = mysql.connector.connect(
host="localhost",
user="root",
password="pswd@01",
database="bshop"
)

# Create a cursor object to interact with the database

cursor = db.cursor()

# Create a table to store books

cursor.execute("""
CREATE TABLE IF NOT EXISTS books (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
author VARCHAR(255),
price DECIMAL(10, 2),
quantity INT
)
""")
# Create a table to store customer details
cursor.execute("""
CREATE TABLE IF NOT EXISTS customers (
customer_id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255),
email VARCHAR(255) UNIQUE
)
""")

def add_book(title, author, price, quantity):


# Insert a new book into the database
query = "INSERT INTO books (title, author, price, quantity) VALUES
(%s, %s, %s, %s)"
values = (title, author, price, quantity)
cursor.execute(query, values)
db.commit()
print("Book added successfully!")

def update_book(book_id, title, author, price, quantity):


# Update book information
query = "UPDATE books SET title = %s, author = %s, price = %s,
quantity = %s WHERE id = %s"
values = (title, author, price, quantity, book_id)
cursor.execute(query, values)
db.commit()
print("Book updated successfully!")

def sell_book(book_id, quantity_sold):


# Sell a book
cursor.execute("SELECT quantity FROM books WHERE id = %s",
(book_id,))
current_quantity = cursor.fetchone()[0]

if current_quantity >= quantity_sold:


new_quantity = current_quantity - quantity_sold
cursor.execute("UPDATE books SET quantity = %s WHERE id =
%s", (new_quantity, book_id))
db.commit()
print(f"Sold {quantity_sold} copies of the book (ID: {book_id}) to
customer.")
else:
print("Insufficient quantity available for sale.")

def add_customer(first_name, last_name, email):


# Add a customer
query = "INSERT INTO customers (first_name, last_name, email)
VALUES (%s, %s, %s)"
values = (first_name, last_name, email)
cursor.execute(query, values)
db.commit()
print("Customer added successfully!")

def list_customers():
# List all the customers in the database
cursor.execute("SELECT * FROM customers")
customers = cursor.fetchall()
if customers:
print("List of Customers:")
for customer in customers:
print(f"ID: {customer[0]}, First Name: {customer[1]}, Last
Name: {customer[2]}, Email: {customer[3]}")
else:
print("No customers found in the database.")

def list_books():
# List all books in the database
cursor.execute("SELECT * FROM books")
books = cursor.fetchall()
if books:
print("List of Books:")
for book in books:
print(f"ID: {book[0]}, Title: {book[1]}, Author: {book[2]}, Price:
{book[3]}, Quantity: {book[4]}")
else:
print("No books found in the database.")

def main():
while True:
print("\nINDORE BOOK SHOP")
print("1. Add a book")
print("2. Update a book")
print("3. Sell a book")
print("4. List all books")
print("5. Add a Customer")
print("6. List all Customers")
print("7. Quit")
choice = input("Enter your choice : ")
if choice == "1":
title = input("Enter book title: ")
author = input("Enter book author: ")
price = float(input("Enter book price: "))
quantity = int(input("Enter book quantity: "))
add_book(title, author, price, quantity)
elif choice == "2":
book_id = int(input("Enter book ID to update: "))
title = input("Enter new book title: ")
author = input("Enter new book author: ")
price = float(input("Enter new book price: "))
quantity = int(input("Enter new book quantity: "))
update_book(book_id, title, author, price, quantity)
elif choice == "3":
book_id = int(input("Enter book ID to sell: "))
quantity_sold = int(input("Enter quantity to sell: "))
sell_book(book_id, quantity_sold)
elif choice == "4":
list_books()
elif choice == "5":
first_name = input("Enter customer's first name: ")
last_name = input("Enter customer's last name: ")
email = input("Enter customer's email: ")
add_customer(first_name, last_name, email)
elif choice == "6":
list_customers()
elif choice == "7":
print("Exiting the INDORE BOOK SHOP.")
break
else:
print("Invalid choice. Please enter a valid option.")

if __name__ == "__main__":
main()

# Close the cursor and database connection when done


cursor.close()
db.close()
OUTPUT
Table :Books
Table : customers
Scope of project

Presentscope:
Theproject“BookShop Management System” will help in reducing
humanlabor. Itwillincreasetheworkingefficiencyandhelpindata
handling. Itsmainfeaturesare:
Easytofindbookdetails
Maintainingrecords
Reducehumaneffort
Userfriendly
Futurescope:
Thisprojectcanbeeasilyimplementedundervarioussituations.
Wecanaddnewfeaturesasandwhenwerequire.Reusabilityis
possibleasandwhenrequireinthisproject.All the modules are flexible.
Wecanalsoincludeonlinepaymentservicestothisprojectusing PayPal or
Paytm.Thiswillhelpcustomertopayonlinefortheirpurchases
usingCredit/Debitcard.Therearemanyfeatureswhichcouldbe
addedtothisprojectformakingthisprojectmoreproductive.
Conclusion

This project is designed to meet therequirements of book shop


management. Ithas been developed in python, keeping inmind the
specifications of the system. Fordesigning the system we have to use
simpledata flow diagrams. Overall the projectteaches us the essential
skills like: Usinganalysis and design techniques like data
flowdiagrams in designing the system.
Bibliography
1. Computer science with Python Textbook for Class XI by Sumita
Arora.
2. Computer science with Python Textbook for Class XII by Sumita
Arora.
3. https://ncert.nic .

You might also like