Project No 1 - 2
Project No 1 - 2
SYSTEM
TABLE OF CONTENTS
1. Project Description
2. Glimpses of Python
3. Glimpses of MySQL
4. Hardware and Software Configuration
5. Tables in the Database
6. Source code
7. Output
8. Bibliography
PROJECT DESCRIPTION
The project Book Store Management System uses Python as front end and MySql as
backend. It aims to maintain the details of details of the books and staffs on the book store
in a systematic way. Book details are stored in MySql table for easy retrieval and access.
The following functionalities are included in the project:
• Python is an open-source language that’s free to use and has a wide range of features
that make it easy to customize.
Python Features and Advantages
• Easy to Code - Python is a very high-level programming language, yet it is effortless to
learn.
• Interpreted.
• Portable.
• Extensible.
GLIMPSES OF MySQL
MySQL is a system that helps to store and manage data efficiently. Database generally
stores data in a structured fashion.
MySQL stores data efficiently in the memory ensuring that data is consistent, and not
redundant. Hence, data access and manipulation using MySQL is quick.
Free to download
MySQL is free to use so that we can download it from MySQL official website without any
cost.
Scalable
Scalability refers to the ability of systems to work easily with small amounts of data, large
amounts of data, clusters of machines, and so on. MySQL server was developed to work
with large databases.
Data Types
It contains multiple data types such as unsigned integers, signed integers, float (FLOAT),
double (DOUBLE), character (CHAR), variable character (VARCHAR), text, blob, date, time,
datetime, timestamp, year, and so on.
Secure
It provides a secure interface since it has a password system which is flexible, and ensures
that it is verified based on the host before accessing the database. The password is
encrypted while connecting to the server.
MySQL has no limit on the number of databases. The underlying filesystem may have a limit
on the number of directories. MySQL has no limit on the number of tables. The underlying
file system may have a limit on the number of files that represent tables. Individual storage
engines may impose engine-specific constraints. InnoDB permits up to 4 billion tables.
Client and Utility Programs
MySQL server also comes with many client and utility programs. This includes Command
line programs such as ‘mysqladmin’ and graphical programs such as ‘MySQL Workbench’.
MySQL client programs are written in a variety of languages. Client library (code
encapsulated in a module) can be written in C or C++ and would be available for clients that
have C bindings.
MySQL is compatible to run on many operating systems, like Novell NetWare, Windows*
Linux*, many varieties of UNIX* (such as Sun*Solaris*, AIX, and DEC* UNIX), OS/2,
FreeBSD*, and others. MySQL also provides a facility that the clients can run on the same
computer as the server or on another computer (communication via a local network or the
Internet).
GUI Support
MySQL provides a unified visual database graphical user interface tool named "MySQL
Workbench" to work with database architects, developers, and Database Administrators.
HARD AND SOFTWARE CONFIGURATION
HARDWARE
• Operating System: Windows 10 or above
• RAM: 4GB
SOFTWARE
• Windows OS
mycon = ms.connect(host='localhost',user="root",password="Password@123",database="
store")
mycursor = mycon.cursor ()
mycon.commit()
def addbooks():
global mycon,mycursor
genre=str(input("Genre:"))
quantity=int(input("Enter quantity:"))
row=mycursor.fetchone()
mycon.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)
+"')")
mycon.commit()
print("""++++++++++++++++++++++
++SUCCESSFULLY ADDED++
++++++++++++++++++++++""")
def searchbook():
global mycon,mycursor
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()
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:
elif l==3:
home=mycursor.fetchall()
if home is not None:
print("""++++++++++++++++++++
++BOOK IS IN STOCK++
++++++++++++++++++++""")
for z in mycursor:
print(z)
else:
mycon.commit()
def addstaff():
global mycon,mycursor
fname=str(input("Enter Fullname:"))
gender=str(input("Gender(M/F/O):"))
age=int(input("Age:"))
add=str(input("Address:"))
print("""+++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++""")
mycon.commit()
def removestaff():
global mycon,mycursor
toy=mycursor.fetchone()
print("""+++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++""")
mycon.commit()
else:
def displaystaff():
global mycon,mycursor
run=mycursor.fetchone()
for t in mycursor:
print(t)
for t in mycursor:
print(t)
else:
mycon.commit()
def available_books():
global mycon,mycursor
for v in mycursor:
print(v)
while True:
print("7.EXIT")
print("*********************************************
**************************")
if ans==1:
addbooks()
elif ans==2:
searchbook()
elif ans==3:
addstaff()
elif ans==4:
removestaff()
elif ans==5:
displaystaff()
elif ans==6:
available_books()
elif ans==7:
mycon.close()
break
else:
print("\nInvalidChoice!!")
OUTPUT
BIBLIOGRAPHY
Computer Science with Python – Sumitha Arora
Preethi Arora