0% found this document useful (0 votes)
21 views28 pages

Sukin - CS Project

The document is an investigatory project report on a Library Management System completed by Sukin Vickram A V for the Senior Secondary Certificate Examination at Velammal Vidhyashram. It includes sections such as an abstract, system configuration, introduction to Python and MySQL, and source code for the project. The project aims to provide an efficient and user-friendly software solution for managing library resources.

Uploaded by

dhanunathi2008
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)
21 views28 pages

Sukin - CS Project

The document is an investigatory project report on a Library Management System completed by Sukin Vickram A V for the Senior Secondary Certificate Examination at Velammal Vidhyashram. It includes sections such as an abstract, system configuration, introduction to Python and MySQL, and source code for the project. The project aims to provide an efficient and user-friendly software solution for managing library resources.

Uploaded by

dhanunathi2008
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/ 28

VELAMMAL VIDHYASHRAM

MAMBAKKAM

SENIOR SECONDARY
CERTIFICATE EXAMINATION

COMPUTER SCIENCE (083)


INVESTIGATORY PROJECT REPORT
ON

Library Management System


2024 – 2025

NAME – SUKIN VICKRAM A V


ROLLNO –
CLASS – XII
SECTION – E
GROUP – CS MATHS

1
BONAFIDE CERTIFICATE
This is to certify that this COMPUTER SCIENCE Investigatory Project on the topic

LIBRARY MANAGEMENT SYSTEM has been successfully completed by SUKIN

VICKRAM A V of class XII (COMPUTER SCIENCE 083), Roll.no......................... at

Velammal Vidhyashram Mambakkam for partial fulfilment of this project as a part of

Senior Secondary Certificate Examination-SSCE, CBSE, New Delhi for the academic

year 2024-2025.

Date: ...................

Signature of Principal Signature of the Guide

Name: Mrs.PRABAVATHI Name:

Ms.VENNILA

Submitted for SSCE 2024-2025, COMPUTER SCIENCE Practical Examination

on.....................

Signature of the Signature of

the Internal Examiner External

Examiner

2
ACKNOWLEDGEMENT

The success of any project depends largely on people associated with it. I

would like to take this opportunity to acknowledge the enthusiasm of all

these personalities.

I hereby express my heartfelt thanks to our Principal Mrs.PRABAVATHI

for having given this opportunity to do the project.

I extend my sincere gratitude to my Computer Science teacher

Ms.VENNILA for the valuable guidance offered to me. Her wholehearted

encouragement and constant stimulant inspiration and advice enabled me to

complete the project successfully.

I am also thankful to all our Teaching Staff and Non-Teaching Staff for

their help during my course of study.

I take this opportunity to express my sincere thanks to my Parents for their

encouragement and support. Last but not the least I am thankful to the

Almighty.

SUKIN VICKRAM A V

XII - E

3
INDEX

S.N PAGE
CONTENTS
O NO

1 5
ABSTRACT

2 SYSTEM CONFIGURATION 6

INTRODUCTION
3 7

RELATION BETWEEN MYSQL


4 12
AND PYTHON

MYSQL QUERIES USED IN THIS


5 13
PROJECT

6 DATABASE CONNECTIVITY 14

7 SOURCE CODE 15

8 OUTPUT (SCREENSHOTS) 23

9 BIBLIOGRAPHY 27

4
ABSTRACT:

The main objective of a library management system


project is to create a software that can manage the details
of books in a library. The software is designed to be used
by the library staff to keep track of the books. The project
aims to provide an efficient and user-friendly way to
manage the library’s resources.

5
SYSTEM CONFIGURATION:
HARDWARE CONFIGURATION

Microsoft windows 10 home/windows 11 home:

 Processor : Intel Core is or equivalent

 Memory :2 GB (32-bit), 4 GB (64-bit)

 Disk space : 1.5 GB of free disk space

SOFTWARE REQUIREMENTS

 1 GB RAM (2 GB+ recommended)

 9-58 GB free hard disk space depending on edition and

configuration, including space required for temporary files

 DVD-ROM drive (if installing from a Media Kit DVD)

 Basic GPU - Any vendor DirectX 9.0 class or better (Pixel

Shader Level 2)

 Intel® Pentium ® or compatible, 1.6 GH} minimum (2GHz+

recommended)

6
 1024x768 or higher-resolution monitor

 MOUSE OR OTHER POINTING DEVICE

INTRODUCTION:

PYTHON:

Python is a high level, Interpreted scripting language developed in the late


I1980, by (Guido van Rossum at the National Research Institute for
Mathematics and Computer Science in the Netherlands. The initial version
was published at the all sources newsgroup in 1991, and version I.0 was
released in 1994.
Python 2.0 was released in 2000, and the 2.x versions were the prevalent
releases until December 200%. At that time, the development team made the
decision to release version 3.0, which contained a few relatively small but
significant changes that were not backward compatible with the 2.x versions.
Python 2 and 3 are very similar, and some features of Python 3 have been
back ported to Python 2. But in general they remain not quite compatible.
Both Python 2 and 3 have continued to be maintained and developed, with
periodic release updates for both. As of this writing, the most recent versions
available are 2.7.15 and 3.6.5. However, an official End of life of January 1,
2020 has been established for Python 2, after which time it will no longer be
maintained. If you are a newcomer to Python, it is recommended that you
focus on Python 3, as this tutorial will do.
Python is still maintained by a core development team at the Institute, and
Guido is still in charge, having been given the title of BDFL (Benevolent
Dictator For Life) by the Python community. The name Python, by the way,
derives not from the snake, but from the British comedy troupe Monty
Python's Flying Circus, of which Guido was, and presumably still is, a fan. It
is common to find references to Monty Python sketches and movies scattered
throughout the Python documentation.

7
PYTHON IS POPULAR:

Python has been growing in popularity over the last few years. The 2018
Stack Overflow Developer Survey ranked Python as the 7th most popular
and the number one most wanted technology of the year. World-class
software development countries around the globe use Python every single
day. According to research by Dice Python is also one of the hottest skills to
have and the most popular programming language in the world based on the
Popularity of programming Language Index.

Python is interpreted:

Many languages are compiled, meaning the source code you create needs to
be translated into machine code, the language of your computer's processor,
before it can be run. Programs written in an interpreted language are passed
straight to an interpreter that runs them directly. This makes for a quicker
development cycle because you just type in your code and run it without the
intermediate compilation step. Python is simple to use and handle.

MYSQL:

Database Management System & Types of DBMS:


A Database Management System (DBMS) is a software application that
interacts with the user, applications and the database itself to capture and
analyze data. The data stored in the database can be modified, retrieved and
deleted and can be of any type like strings, numbers, images etc.

Types of DBMS:
8
There are mainly 4 types of DBMS, which are Hierarchical, Relational,
Network, and Object-Oriented DBMS,

Hierarchical DBMS: As the name suggests, this type of DBMS has a style
of predecessor successor type of relationship. So, it has a structure similar to
that of a tree. Where in the nodes represent records and the branches of the
tree represent fields.

Relational DBMS (RIDBMS): This type of DBMS, uses a structure that


allows the users to identify and access data in relation to another piece of
data in the database.

Network DBMS: This type of DBMS supports many to many relations


wherein multiple member records can be linked.

Object-oriented DBMS: This type of DBMS uses small individual software


called objects. Each object contains a piece of data, and the instructions for
the actions to be done with the data.

Structured Query Language (SQL):

SQL is the core of a relational database which is used for accessing and
managing the database. By using SQL you can add, update or delete row s of
data, retrieve subset of information, modify databases and perform many
actions. The different subsets of SQL are as follows,

 DDL (Data Definition Language): It allows you to perform various


operations on the database such as CREATE, ALTER, DELETE
objects.
 DML (Data Manipulated language): It allows you to access and
manipulate data. It helps you to inset, update, delete and retrieve data
from the database. .
 DCL (Data Control Language): lt allows you to control access to the
database. Example GRANT or REVOKE access permission.
9
 TCL (Transaction Control Language): It allows you to deal with the
transaction of the database. Example Commit, Rollback, Save point,
Set Transaction.

MYSQL & its Features:

MySQL is an open-source relational database management system that


works on many platforms. It provides multi-user access to support
many storage engines and is backed by Oracle. So, you can buy a
commercial license version from Oracle to get premium support
services.

The features of MySQL are as follows:

Ease of Management -The software very easily gets downloaded and


also uses an event scheduler to schedule the tasks automatically.

 Robust Transactional Support - Holds the ACID (Atomicity,


Consistency Isolation and Durability) property, and also allows
distributed multi-version support.
 Comprehensive Application Development - MYSQL has
plugin libraries to embed the database into any application. It
also supports stored procedures triggers, functions, views and
many more for application development. You can refer to the
RDS Tutorial to understand Amazon's RDBMS.
 High Performance - Provides fast load utilities with distinct
memory caches and table index partitioning.
 Low Total Cost Of Ownership - This reduces licensing costs
and hardware are expenditures.
 Open Source & 24 * 7 Support - This RDBMS can be used on
any platform and offers 24*7 support for open source and
enterprise edition.
 Secure Data Protection - MYSQL supports powerful
mechanisms to ensure that only authorized users have access to
the databases.

10
 High Availability - MYSQL can run high-speed master slave
replication configurations and it offers cluster servers.
 Scalability & Flexibility - With MYSQL you can run deeply
embedded applications and create data warehouses holding a
humongous amount of data.

MySQL Data Types:

 Numeric - This data type includes integers of various sizes,


floating-point (real) of various precisions and formatted numbers.
 Character-string - These data types either have a fixed, or a
varying number of characters. This data type also has a variable-
length string called CHARACTER LARGE OBJECT (CLOB)
which is used to specify columns that have large text values.
 Bit-string - These data types are either of a fixed length or
varying length of bits. There is also a variable-length bit string
data type called BINARY LARGE OBJECT (BLOB), which is
available to specify columns that have large binary values such as
images.
 Boolean - This data type has TRUE or FALSE values. Since
SQL, has NULL values, a three-valued logic is used, which is
UNKNOWN.
 Date & Time - The DATE data type has: YEAR, MONTH, and
DAY in the form YYYY-MM-DD. Similarly, the TIME data type
has the components HOUR, MINUTE, and SECOND in the form
HH:MM: SS. These formats can change based on the
requirement.
 Timestamp & Interval - The TIMESTAMP data type includes a
minimum of six positions, for decimal fractions of seconds and
an optional WITH TIME ZONE qualifier in addition to the
DATE and TIME fields. The INTERVAL data type mentions a
relative value that can be used to increment or decrement an
absolute value of a date, time, or timestamp.

11
RELATION BETWEEN

MYSQL AND PYTHON:

While working with Python we need to work with databases, they may be

of different types like MySQL, SQLite, NoSQL, etc. In this article, we

will be looking forward to how to connect MySQL databases using

MySQL Connector/Python.

MySQL Connector module of Python is used to connect MySQL

databases with the Python programs, it does that using the Python

Database API Specification v2.0 (PEP 249). It uses the Python standard

library and has no dependencies.

12
MYSQL QUERIES USED IN

THIS PROJECT:

 Create Database

 Create Table

 Insert Query

 Select Query

 Delete Query

 Update Query

13
DATABASE CONNECTIVITY:
Arguments required to connect MySQL from Python:

You need to know the following detail of the MySQL server to perform
the connection from Python.

 Username -i.e., the username that you use to work with MYSQL
Server. The default username for the MySQL database is a root.
 Password - Password is given by the user at the time of installing
the MYSQL database. If you are using root then you won't need the
password.
 Host Name - is the server name or IP address on which MySQL is
running. If you are running on local host, then you can use local
host, or it's IP, i.e. 127.0.0.0
 Database Name - Database name to which you want to connect.

14
SOURCE CODE:
import mysql.connector

mydb=mysql.connector.connect(host='localhost',user='root')

mycursor=mydb.cursor()

mycursor.execute("CREATE DATABASE IF NOT EXISTS LIBRARY")

mycursor.execute("USE LIBRARY")

rec="create table IF NOT EXISTS Book(bno INTEGER PRIMARY

KEY,bname VARCHAR(50) NOT NULL,bauth VARCHAR(50) not

null,bprice INTEGER NOT NULL,bqty INTEGER NOT NULL)"

mycursor.execute(rec)

mydb.close()

mycon=mysql.connector.connect(host='localhost',user='root',database='LIB

RARY')

mycur=mycon.cursor()

# function to insert book record

15
def insertbook():

bno=int(input("Enter Book Code:"))

bname=input("Enter Book Name:")

bauth=input("Enter Book Author:")

bprice=int(input("Enter Book Price:"))

bqty=int(input("Enter Book Quantity:"))

qry="INSERT INTO book VALUES(%s,%s,%s,%s,%s)"

data=(bno,bname,bauth,bprice,bqty)

mycur.execute(qry,data)

mycon.commit()

print("\t\tRecord ADDED successfuly...")

# Function to display book record

def displaybook():

qry="SELECT * FROM book"

mycur.execute(qry)

data=mycur.fetchall()

count=mycur.rowcount

print("\t\t Total Book Records.........:",count,"\n")

16
for (bno,bname,bauth,bprice,bqty) in data:

print("Book Code: \t",bno)

print("Book Name: \t",bname)

print("Book Author: \t",bauth)

print("Book Price: \t",bprice)

print("Book Quantity:\t",bqty)

print(".................................")

# function to search book record

def searchbook():

bno=int(input("Enter book number to be searched...:"))

qry="SELECT * FROM book WHERE bno=%s"

rec=(bno,)

mycur.execute(qry,rec)

data=mycur.fetchall()

count=mycur.rowcount

if count!=0:

print("\t\t Book Records found.........:\n")

for (bno,bname,bauth,bprice,bqty) in data:

print("Book Code:\t",bno)
17
print("Book Name:\t",bname)

print("Book Author:\t",bauth)

print("Book Price:\t",bprice)

print("Book Quantity:\t",bqty)

print(".................................")

else:

print("\t\t\t Record NOT found..!!!")

# function to delete book record

def deletebook():

bno=int(input("Enter book number to be deleted...:"))

qry="SELECT * FROM book WHERE bno=%s"

rec=(bno,)

mycur.execute(qry,rec)

data=mycur.fetchall()

count=mycur.rowcount

if count!=0:

print("\t\t Book Records found.........:\n")

for (bno,bname,bauth,bprice,bqty) in data:

print("Book Code:\t",bno)
18
print("Book Name:\t",bname)

print("Book Author:\t",bauth)

print("Book Price:\t",bprice)

print("Book Quantity:\t",bqty)

print(".................................")

opt=input("Are you SURE to DELETE above record (Y/N)...:")

if opt=="Y" or opt=="y" :

qry= "DELETE FROM book WHERE bno=%s"

rec=(bno,)

mycur.execute(qry,rec)

print("\n\t\tRecord deleted Successfully...... ")

mycon.commit()

else:

print("\t\t\t Record NOT found..!!!")

# function to update book record

def updatebook():

bno=int(input("Enter book number to be updated...:"))

qry="SELECT * FROM book WHERE bno=%s"


19
rec=(bno,)

mycur.execute(qry,rec)

data=mycur.fetchall()

count=mycur.rowcount

if count!=0:

print("\t\t Book Records found.........:\n")

for (bno,bname,bauth,bprice,bqty) in data:

print("Book Code:\t",bno)

print("Book Name:\t",bname)

print("Book Author:\t",bauth)

print("Book Price:\t",bprice)

print("Book Quantity:\t",bqty)

print(".................................")

opt=input("Are you SURE to UPDATE above record (Y/N)...:")

if opt=="Y" or opt=="y" :

print ("\n\t\tEnter new Data....")

bname=input("Enter New Book Name:")

bauth=input("Enter New Book Author:")

bprice=int(input("Enter New Book Price:"))


20
bqty=int(input("Enter New Book Quantity:"))

qry= ("UPDATE book SET bname=%s,bauth=%s,bprice=%s,bqty=

%s WHERE bno=%s")

rec=(bname,bauth,bprice,bqty,bno)

mycur.execute(qry,rec)

print("\n\t\tRecord Updated Successfully...... ")

mycon.commit()

else:

print("\t\t\t Record NOT found..!!!")

# code to display menu

while True :

print("\n\t\t LIBRARY BOOK RECORD MANAGEMENT\n")

print("==================================")

print("\t\t 1. Add New Book record")

print("\t\t 2. Display Book record")

print("\t\t 3. Search Book record")

print("\t\t 4. Delete Book record")

print("\t\t 5. Update Book record")

21
print("\t\t 6. EXIT")

print("==================================")

choice=int(input("Enter choice 1-6:"))

if choice==1:

insertbook() # function called for inserting book

elif choice==2:

displaybook() # function called for displaying records of book(s)

elif choice==3:

searchbook() # function called for searching book

elif choice==4:

deletebook() # function called for deleting book

elif choice==5:

updatebook() # function called for updating book record

elif choice==6:

mycon.close()

print("\n Thanks have a nice day.........")

break

else :

print("\t!!!wrong choice... please enter choice 1-6:")

22
OUTPUT:

23
24
25
26
27
BIBLIOGRAPHY:
 www.youtube.com

 www.wikipedia.com

 www.google.com

 https://www.geeksforgeeks.org/connect-mysql-
database-using-mysql-connector-python/

28

You might also like