DBMS Report
DBMS Report
CERTIFICATE
This is to certify that the mini project work entitled
“Smart Library Booking System”
is a bonafide work carried out by
Abhinav Naik 1AP21CS001
Basha E 1AP21CS009
Alfiya Hassan 1AP21CS006
Gnanesh V S 1AP21CS019
The satisfaction that accompanies the successful completion of any task would be
incomplete without the mention of the people who made it possible, whose constant guidance
and encouragement crowned the efforts with success.
We thank the principal, Dr. D G Anand, APS College of Engineering, for providing with
all the facilities that helped us to carry out the work easily.
We are immensely grateful to our internal guide Prof. Astha Tiwari, Assistant Professor,
Department of Computer Science and Engineering for her guidance, encouragement and
cooperation.
We would also like to thank all the teaching and non-teaching staff of Department of
Computer Science and Engineering for their support.
The system aims to streamline the borrowing process, enhance user experience, and
optimize resource utilization through the integration of modern technology.
Users can access an online catalogue containing the library's collection of books and
reserve them through a user-friendly interface, eliminating the need for physical presence at
the library. The system offers real-time updates on the availability of books, ensuring accurate
information for users making reservations.
Through this mini project, we aim to contribute to the modernization of college library
services, making them more efficient, accessible, and user-friendly. By embracing technology,
educational institutions can better meet the evolving needs of their academic community and
enhance the overall learning experience.
TABLE OF CONTENTS
1.1 Overview 1
1.2 Applications 2
2 LITERATURE SURVEY 3
2.1 Introduction 3
2.3 Limitations 4
PROPOSED SYSTEM
3 5
AND ITS OBJECTIVES
3.1 Problem Statement 5
Objectives of the proposed
3.2 5
system
3.3 Proposed Solution 6
3.4 Methodology 6
SYSTEM
4 7
REQUIREMENTS
User software and
4.1 7
hardware Requirements
Development software
4.2 7
requirements
Development hardware
4.3 7
requirements
5 SYSTEM DESIGN 8
6 IMPLEMENTATION 10
7.6 Logout 31
RESULTS AND
8 32
CONCLUSIONS
REFERENCES 33
TABLE OF FIGURES
CHAPTER 1
INTRODUCTION
1.1 Overview
The DBMS facilitates seamless integration of prebooking features with other library
functions, such as catalogue management, circulation, and user authentication. It enables
users to search for books, reserve them, and manage their bookings through a user-friendly
interface. Additionally, the DBMS ensures data integrity and security, safeguarding
sensitive patron information and transaction records.
Prebooking data stored in the DBMS provides valuable insights into user
preferences and demand patterns, enabling libraries to optimize collection development and
resource allocation strategies. Libraries can allocate resources efficiently, ensuring that
high-demand items are readily available while minimizing unnecessary duplication of less
popular materials.
Furthermore, the DBMS automates various aspects of the prebooking process, such
as notifications, reminders, and inventory management, streamlining library operations and
reducing administrative burden. Overall, the integration of prebooking functionality into a
library system powered by a DBMS enhances user satisfaction, promotes efficient resource
management, and improves the overall effectiveness of library services.
5. Feedback collection:
Prebooking systems provide opportunities for users to provide feedback on
library collections and services. Libraries can gather user comments and
suggestions to continuously improve their offerings and enhance user satisfaction.
6. Enhanced Accessibility:
Prebooking facilitates access to library materials for users with busy
schedules or limited mobility. They can reserve books online and pick them up at
their convenience, eliminating the need for multiple trips to the library.
CHAPTER 2
LITERATURE SURVEY
2.1 Introduction
Literature survey is the most important step in the software development
process. Before developing any tool, it is very necessary to determine the time factor,
economy and other essential requirements of the design. Once these things are satisfied,
then next steps are to determine which operating system and languages can be used for
developing the tools.
Online books booking systems play a crucial role in modern libraries and College
Libraries, providing users with convenient access to a wide range of titles. These systems
typically include features such as book search, availability checking, and pre-ordering
capabilities. Research by Gnanesh V S highlights the importance of efficient inventory
management and user-friendly interfaces in enhancing the online book ordering experience.
User experience (UX) is a critical aspect of online book services, influencing user
satisfaction and engagement. Research by Alfiya Hassan identifies factors such as ease of
use, accessibility, and personalized recommendations as key determinants of user
satisfaction in online book services. Implementing intuitive interfaces and responsive
customer support systems can contribute to a positive user experience.
Checking the availability itself may be a laborious task. Survey by Abhinav Naik
highlights that there must be some system that has to incorporated in order make this task
easier and time efficient.
College Library, the current college library system operates within a traditional
framework, where users physically visit the library to borrow books without prior
knowledge of the availability of specific titles. However, in the current landscape of
technological advancements, AI-driven chatbots have emerged as notable tools in various
applications, showcasing capabilities in automated responses and user interactions.
2.3 Limitations
1. Limited Accessibility: Users need to physically visit the library to check the
availability of books, which can be inconvenient, especially for those with busy
schedules or limited mobility.
2. Time Consuming: Searching for books in the library without prior knowledge of
their availability can be time-consuming, particularly if the desired book is not in
stock or is misplaced.
3. Uncertainty: Users may experience uncertainty about the availability of desired
books, leading to frustration and wasted time if the books are not available when
they visit the library.
4. Inefficient Resource Utilization: Without prior knowledge of book availability,
users may make unnecessary trips to the library, resulting in inefficient resource
utilization and increased foot traffic in the library.
5. Limited Information: Users may not have access to comprehensive information
about the library's collection, including new arrivals, popular titles, or related
resources, which could enrich their academic or personal interests.
6. Inconvenient Reservation Process: If a book is unavailable, users may need to go
through a manual reservation process, which can be cumbersome and time-
consuming, potentially leading to delays in accessing the desired resources.
7. Risk of Disappointment: Users may experience disappointment or frustration if
they are unable to find the books they need during their library visit, negatively
impacting their academic or research activities.
8. Difficulty in Planning: Without knowing the availability of specific books in
advance, users may find it challenging to plan their study or research projects
effectively, leading to suboptimal outcomes.
CHAPTER 3
Key Issues:
1. Database Setup:
o Create a database with tables for books, users, transactions, and
reservations.
o Each table should have fields for relevant information like book title,
author, availability status, user details, etc.
2. User Interface Development:
o Develop a simple interface for students to search for books and check their
availability.
o Implement a login system for users and librarians to access the system.
3. Book Availability Tracking:
o Update the availability status of books in real-time as they are borrowed or
returned.
o Enable users to see if a book is available before visiting the library.
4. Reservation System:
o Allow users to reserve books that are currently unavailable.
o Notify users when reserved books become available.
5. Security Measures:
o Implement basic security measures like encryption of sensitive data and
user authentication.
6. Testing and Deployment:
o Test the system thoroughly to ensure functionality and usability.
o Deploy the system and provide training to users and librarians.
CHAPTER 4
SYSTEM REQUIREMENTS
2. RAM: 2GB.
5. Database: MySQL
6. IDE: VSCode
2. RAM: 4GB
3. Storage: 1GB
CHAPTER 5
SYSTEM DESIGN
The admin may have complete access over the database and the user
may have limit access over the database.
Figure 5-a
The home page is implemented using HTML and CSS which has 3
interfaces that is for sign in, sign up and admin login. This web application is
a single page web application.
The single page web application is made interactive using React.js including
CSS. The are 2 sever scripts running:
The first script uses python script with flask API. The second script
uses node.js and express.js to handle login.
The database is created using MySQL through which the data items
are displayed onto the web page. The appropriate references are made between
the relations and the tables.
The database queries make sure that the database is consistent every
state after it is changed. The SQL queries are embedded in to python script
and the node script files so that whenever a request is made the respective SQL
query is executed.
Each user gets a different view of the database like the admin gets the
complete view and the user gets a limited view of the database.
CHAPTER 6
IMPLEMENTATION
Figure 6-a
Here Isbn, loan_id, card_id and author_id are the primary keys.
Authors, Book_authors, Book, Fines, Borrower, Book_loans are the tables.
Figure 6-b
• This E-R diagram represents the relation between various entities in this database.
• Here authors, book, borrower and Fines are entities represented using a rectangle.
• The Book_authors, Borrows and Book_loans are Relations of their entities.
• Each entity has its own primary key and its attributes.
if (result.length === 0) {
// If no user found with provided credentials, render the
signin page again with an error message
return res.status(401).json({ message: 'Invalid email or
password' });
}
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
# server.py
from flask import Flask, render_template
from flask import jsonify
from flask import request
import mysql.connector
import errorCodes
import json
import datetime
app=Flask(__name__,static_folder="../static/dist",
template_folder="../static")
@app.route("/addBorrower",methods=['GET', 'POST'])
def addBorrower():
data = request.get_json(force=True)
cursor.execute(query,(card_id,data["ssn"],data["name"],data["addr
ess"],data["phone"]))
response = {'message':'Borrower Added','success':True}
cnx.commit()
except mysql.connector.Error as err:
if(err.errno in errorCodes.errorCodeMessage):
response =
{'message':errorCodes.errorCodeMessage[err.errno],'success':False
}
else:
response = {'message':'Borrower Creation
failed','success':False}
return jsonify(response)
@app.route("/searchBook",methods=['GET', 'POST'])
def searchBook():
data = request.get_json(force=True)
searchQuery = data["searchQuery"]
ISBNList = []
try:
cursor.execute(query1,("%"+searchQuery+"%","%"+searchQuery+"%","%
"+searchQuery+"%"))
for row in cursor:
type_fixed_row = tuple([el.decode('utf-8') if
type(el) is bytearray else el for el in row])
ISBNList.append(type_fixed_row[0])
if(len(ISBNList)>0):
ISBN = list(set(ISBNList))
format_strings = '('+','.join(['%s'] * len(ISBN))+')'
query2 = 'select
b.ISBN,b.Title,GROUP_CONCAT(a.name),b.isCheckedOut from Book b
left outer join BOOK_AUTHORS ba on b.isbn = ba.isbn left outer
join authors a on ba.author_id = a.author_id where b.isbn IN ' +
format_strings + ' group by b.isbn'
cursor.execute(query2,tuple(ISBN))
for row in cursor:
type_fixed_row = tuple([el.decode('utf-8') if
type(el) is bytearray else el for el in row])
searchResult.append(type_fixed_row)
response =
{'searchResult':searchResult,'message':'search
success','success':True}
else:
response = {'searchResult':None,'message':'search
success','success':True}
except mysql.connector.Error as err:
@app.route("/checkoutBook",methods=['GET', 'POST'])
def checkoutBook():
data = request.get_json(force=True)
cardId = data["borrowerId"]
isbn = data["isbn"]
response = None
try:
query = 'select 1 from BORROWER where card_id = %s'
cursor.execute(query,(cardId,))
isBorrower = 0
for row in cursor:
isBorrower = row[0]
if(isBorrower):
query = 'select isCheckedOut from BOOK where isbn =
%s'
isCheckedOut = 1
cursor.execute(query,(isbn,))
for row in cursor:
isCheckedOut = row[0]
query = 'select count(*) >= 3 from BOOK_LOANS where
card_id = %s and date_in is null'
isCountExceeded = 1
cursor.execute(query1,(isbn,cardId,dateOut,dueDate))
cursor.execute(query2,(isbn,))
cnx.commit()
response = {'message':'Book Checked
Out','success':True}
else:
response = {'message':'Invalid Borrower
Id','success':False}
except mysql.connector.Error as err:
if(err.errno in errorCodes.errorCodeMessage):
response =
{'message':errorCodes.errorCodeMessage[err.errno],'success':False
}
else:
response = {'message':'Borrower Creation
failed','success':False}
@app.route("/searchBookLoan",methods=['GET', 'POST'])
def searchBookLoan():
data = request.get_json(force=True)
searchQuery = data["searchQuery"]
searchResult = []
query = 'select
bl.loan_id,bl.isbn,bl.card_id,b.bname,bl.date_out,bl.due_date
from BOOK_LOANS bl join BORROWER b on bl.card_id = b.card_id
where (bl.isbn like %s or bl.card_id like %s or b.bname like %s)
and date_in is null'
try:
cursor.execute(query,("%"+searchQuery+"%","%"+searchQuery+"%","%"
+searchQuery+"%"))
for row in cursor:
type_fixed_row = tuple([el.decode('utf-8') if
type(el) is bytearray else el for el in row])
searchResult.append(type_fixed_row)
response = {'searchResult':searchResult,'message':'search
success','success':True}
except mysql.connector.Error as err:
if(err.errno in errorCodes.errorCodeMessage):
response =
{'searchResult':None,'message':errorCodes.errorCodeMessage[err.er
rno],'success':False}
else:
response =
{'searchResult':None,'message':'searchFailed','success':False}
return jsonify(response)
@app.route("/checkinBook",methods=['GET', 'POST'])
def checkinBook():
@app.route("/calculateFines",methods=['GET', 'POST'])
def calculateFines():
response = None
query = 'select loan_id,due_date,date_in from BOOK_LOANS
where date_in > due_date or curdate()> due_date'
cursor.execute(query)
today = datetime.date.today()
rows = cursor.fetchall()
resultSet = []
@app.route("/fetchFines",methods=['GET','POST'])
@app.route("/settleFines",methods=['GET', 'POST'])
def settleFines():
data = request.get_json(force=True)
loanId = data["loanId"]
response = None
format_strings = ','.join(['%s'] * len(loanId))
query = 'update fines set paid = true where loan_id in (%s)'
try:
cursor.execute(query%format_strings,tuple(loanId))
cnx.commit()
response = {'message':'fine settled','success':True}
except mysql.connector.Error as err:
if(err.errno in errorCodes.errorCodeMessage):
response =
{'message':errorCodes.errorCodeMessage[err.errno],'success':False
}
else:
response = {'message':'Fine settlement
failed','success':False}
return jsonify(response)
if __name__ == "__main__":
app.run()
CHAPTER 7
THE FINAL OUTCOMES
7.1 Login Page
Figure 7-a
Figure 7-b
Figure 7-c
Figure 7-d
Figure 7-e
7.6 Logout
Figure 7-f
CHAPTER 8
RESULTS AND CONCLUSIONS
Results:
Conclusions:
1. Positive Impact on User Experience: The digital library system has positively
impacted user experience by reducing time wastage, improving accessibility, and
streamlining the reservation process.
2. Efficiency Gains for Library Staff: The automation of book availability tracking
and reservation management has freed up valuable time for library staff, allowing
them to focus on other tasks and providing better assistance to users.
3. Technological Advancements Enhance Library Services: The successful
implementation of the digital library system demonstrates how leveraging modern
technologies can enhance traditional library services and adapt to the evolving
needs of users.
REFERENCES
• MySQL: https://dev.mysql.com/doc/
• Python: https://www.python.org/doc/
• React.js: https://react.dev/learn
• Node.js: https://nodejs.org/docs/latest/api/
• Express.js: https://expressjs.com/en/5x/api.html
• Flask: https://flask.palletsprojects.com/en/3.0.x/api/
• https://github.com/topics/library-management-system
• https://github.com/topics/library-management-system?l=php&o=asc&s=stars
• Node.js in Action
• React Quickly: Painless Web Apps with React, JSX, Redux, and GraphQL