0% found this document useful (0 votes)
11 views19 pages

Project Report

The document outlines a project on a Book Management System developed by students under the guidance of Prof. Shailender Kumar. It details the project's objectives, implementation, results, challenges faced, and sources of information, emphasizing the use of database management principles such as normalization, data integrity, and secure authentication. The system aims to efficiently manage library operations, including book tracking, student records, and borrowing transactions.

Uploaded by

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

Project Report

The document outlines a project on a Book Management System developed by students under the guidance of Prof. Shailender Kumar. It details the project's objectives, implementation, results, challenges faced, and sources of information, emphasizing the use of database management principles such as normalization, data integrity, and secure authentication. The system aims to efficiently manage library operations, including book tracking, student records, and borrowing transactions.

Uploaded by

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

DEPARTMENT OF COMPUTER SCIENCE

AND ENGINEERING

DATABASE MANAGEMENT SYSTEMS

SUBMITTED TO SUBMITTED BY:

Prof. Shailender Kumar Aditya Chaturvedi (23/CS/023)


Aditya Bose (23/CS/022)
INDEX

S No. Objective Page No.

1. ACKNOWLEDGEMENT

2. CERTIFICATE

3.
DESCRIPTION OF PROJECT
1.OBJECTIVE
2.THEORY
3.IMPLEMENTATION
4.RESULTS
5.CHALLENGES

4. SOURCES
ACKNOWLEDGEMENT

We would like to sincerely thank Dr. Shailender Kumar sir for


his valuable guidance, encouragement, and support
throughout the development of our project, Book
Management System.

We also acknowledge each other's efforts and teamwork in


successfully designing and implemenCng the system. The
knowledge and experience gained during this project have
greatly enhanced our understanding of database
management systems.

We are truly grateful for the opportunity to work under Dr.


Shailender Kumar mentorship and for the learning experience
this project has provided.
CERTIFICATE

This is to cer+fy that the content of the project +tled “Book Management
System” is the original and genuine work of Mr. Aditya Chaturvedi and
Mr.Aditya Bose.
The project report has been submiCed to Dr. Shailender Kumar , Faculty for the
subject: Database Management Systems (DBMS), and represents a thorough
and commiCed research endeavor completed under his valuable guidance.

This project embodies dedicated effort and sincere engagement with database
theory, system design, and prac+cal implementa+on, demonstra+ng a strong
interest in developing secure, consistent, and scalable informa+on systems for
real-world applica+ons.

I would like to acknowledge the support and encouragement extended by Dr.


Shailender Kumar whose insights and mentorship have been instrumental in
shaping this project.

Addi+onally, I am grateful to DTU for providing the academic environment and


technical resources necessary to successfully complete this project.

STUDENT FACULTY
Aditya Bose Dr. Shailender Kumar
Aditya Chaturvedi
OBJECTIVE

The primary goal of this Database Management System (DBMS) project is to


design, implement, and deploy a relational database solution for a Book
Management System, ensuring efficient, scalable, and secure management of
library operations.
The system targets the following key areas:

1. Books Management
• Store detailed information about each book, including:
o Title
o Author
o Genre
o Year of publication
o Available quantity
• Enable CRUD operations (Create, Read, Update, Delete) on book
records.
• Maintain real-time tracking of available and borrowed copies.
• Prevent redundancy through proper normalization (e.g., each book
uniquely identified by book_id).

2. Student Management
• Maintain an organized record of students who are eligible to borrow
books.
• Store student attributes:
o Name
o Email (unique)
o Department
• Manage the borrowing history of each student to track their activities and
maintain accountability.

3. Borrowing and Returning Books


• Record every borrowing operation including:
o Borrow date
o Expected return deadlines
o Actual return date
o Status (whether returned or not)
• Update book inventory in real-time:
o Decrement quantity when issued
o Increment quantity when returned
• Implement overdue tracking to identify late returns.

4. Administrative Authentication and Monitoring


• Provide a secure, session-based login system for administrative users.
• Hash admin passwords before storage to ensure authentication security.
• Allow admins to monitor:
o Current inventory status
o Active borrowing records
o Overdue returns
o Top borrowed books and active students

5. Data Integrity and Normalization


• Enforce entity integrity (unique identifiers for books, students, admins,
borrow records).
• Enforce referential integrity through foreign key constraints between
tables (borrow_records referencing students and books).
• Normalize the database schema up to Third Normal Form (3NF) to
minimize redundancy and maintain logical consistency.

6. Implement Fine Management:


Automatically calculate and store penalties for overdue book returns,
maintaining accurate financial records linked to borrowing transactions and
ensuring that students are held accountable for late returns.
THEORY
The Book Management System applies multiple important Database
Management System (DBMS) concepts and best practices to ensure efficient
storage, retrieval, and management of structured data.

1. Relational Model
• Data is organized into tables (relations) where each row is a tuple and
each column represents an attribute.
• Each table (entity) is uniquely identified by a Primary Key:
o books.book_id
o students.student_id
o borrow_records.record_id
o admins.admin_id
• Relationships between entities are established using Foreign Keys to
maintain relational integrity.

2. Entity-Relationship (ER) Modeling


• Before creating the schema, an Entity-Relationship (ER) diagram was
conceptually designed.
• Core entities:
o Book (book_id, title, author, genre, quantity)
o Student (student_id, name, email, department)
o Admin (admin_id, username, password)
o Borrow_Record (record_id, student_id, book_id, borrow_date,
return_date, returned)
• Relationships:
o Student borrows Book (many-to-many through Borrow Records).
o Admin manages all entities indirectly.

3. Normalization
To avoid redundancy and anomalies, the database design follows normalization
principles, up to Third Normal Form (3NF):

Step Normal Form Action Taken


No multi-valued attributes (each field contains
1NF Atomic columns
indivisible data).
Remove Partial All non-prime attributes fully depend on the
2NF
Dependency primary key (especially in borrow_records).
Step Normal Form Action Taken
Non-key attributes are only dependent on primary
Remove Transitive
3NF keys (e.g., borrow_date depends directly on
Dependency
record_id).

• Example:
Borrow records store only student_id and book_id, not redundant student names or
book titles.

4.Constraints and Data Integrity


To ensure correctness and reliability, constraints are heavily utilized:

• Primary Keys: Uniquely identify each row.


• Foreign Keys: Maintain referential integrity across students, books,
and borrow_records.
• NOT NULL Constraints: Enforce mandatory fields like username,
book title, student email.
• UNIQUE Constraints: Prevent duplicate student emails and admin
usernames.
• CHECK Constraints:
o quantity >= 0 for books.
o Logical consistency in borrow and return dates.

Example SQL for constraint:

sql
CopyEdit
ALTER TABLE books
ADD CONSTRAINT positive_quantity CHECK (quantity >=
0);

5. Transactions and Atomicity


Though not explicitly coded with BEGIN/COMMIT blocks yet, the system
operations are designed considering transactional behavior:

• Book issue operation:


o Decrease available quantity.
o Record borrow information.
o Both operations must succeed together (Atomicity).
• Book return operation:
o Update return status.
o Increment book quantity.

In production, explicit SQL transactions (BEGIN; COMMIT; ROLLBACK;)


would be used to guarantee ACID properties.

6. Referential Integrity
By using Foreign Keys, the system ensures:

• A borrow record cannot exist for a non-existent student or book.


• Cascading rules could be optionally applied (ON DELETE CASCADE)
to handle dependent data clean-up (future enhancement).

7 .Database Security
• Authentication:
o Admins must log in to access any data-modifying operation.
• Password Management:
o Passwords are stored as bcrypt hashes to prevent leakage.
• Environment Variables:
o Credentials like DB_USER, DB_PASSWORD are hidden in .env
files.
• Session Management:
o express-session manages user sessions securely.
• Access Control:
o APIs are protected with middleware — unauthenticated users
cannot perform CRUD operations.

8 .Query Optimization
• Simple Indexing:
o PostgreSQL automatically creates indexes on Primary Keys.
o Queries like searching for a student by student_id or book by
book_id are efficiently optimized.
• Selective Queries:
o Filtering by genres or overdue borrowing dates uses SQL WHERE
clauses to minimize data retrieval overhead.
IMPLEMENTATION
1.Admins Table
The admins table is responsible for storing administrative user credentials
required for system login and management activities. Each admin has a unique
admin_id as the primary key, along with a username and a securely hashed
password. These fields ensure that only authenticated users can access the
management functionalities of the system. The username is constrained to be
unique to avoid duplication, and the password is encrypted for security.

2.Books Table
The books table holds detailed information about each book available in the
library or system inventory. Each book entry is uniquely identified by a
book_id. Other important attributes include title, author, genre, year_published,
and quantity. The quantity field reflects the number of copies currently available
for borrowing. This table is critical for managing the catalog, tracking
inventory, and allowing users to perform operations such as search, update, or
delete book records.

3.Students Table
The students table maintains the records of all students who are registered
borrowers within the system. Each student is assigned a unique student_id as
the primary key. Attributes associated with students include name, email, and
department. The email field is set to be unique, ensuring that no two students
can register with the same email address. This table enables the tracking of
individual student borrowing histories and supports features like overdue
notifications.

4.Borrow Records Table


The borrow_records table is used to track all borrowing and returning
transactions. Each transaction record is uniquely identified by a record_id. It
stores references to the student_id and book_id to establish the relationship
between a student and the book they have borrowed. The table also records the
borrow_date, optional return_date, and a boolean returned status indicating
whether the book has been returned. This table enforces foreign key constraints
linking to the students and books tables, maintaining strict referential integrity
and ensuring that borrow operations are tied to valid students and books.
the schema is organized around maintaining a normalized, relational structure
that upholds data consistency, reduces redundancy, and facilitates efficient data
retrieval and manipulation.
The relationships among these tables are carefully designed to reflect real-world
operations like book issue, return, and borrower management while ensuring
robust security and integrity of the system.

5.Fines Table
The fines table manages financial penalties related to overdue book returns.
Each fine record contains:
• fine_id (Primary Key)
• borrow_id (Foreign Key referencing borrow_records)
• amount (monetary value of the fine)
• status (Pending or Paid)
• created_at and updated_at timestamps
The fines system ensures accountability and promotes timely returns by
students. It maintains a direct linkage between a fine and its corresponding
borrow transaction.

Important SQL Queries and Scripts


• Insert a New Book:
sql
CopyEdit
INSERT INTO books (title, author, genre, year_published,
quantity)
VALUES ('The Great Gatsby', 'F. Scott Fitzgerald',
'Classic', 1925, 5);

• Borrow a Book (Pseudocode):


sql
CopyEdit
BEGIN;
UPDATE books SET quantity = quantity - 1 WHERE book_id =
$book_id AND quantity > 0;
INSERT INTO borrow_records (student_id, book_id,
borrow_date, returned)
VALUES ($student_id, $book_id, CURRENT_DATE, false);
COMMIT;

• Return a Book:
sql
CopyEdit
BEGIN;
UPDATE borrow_records SET return_date = CURRENT_DATE,
returned = true WHERE record_id = $record_id;
UPDATE books SET quantity = quantity + 1 WHERE book_id =
(SELECT book_id FROM borrow_records WHERE record_id =
$record_id);
COMMIT;

• List Overdue Books:


sql
CopyEdit
SELECT * FROM borrow_records
WHERE returned = false AND borrow_date < CURRENT_DATE -
INTERVAL '14 days';
RESULTS
The relational database for the Book Management System was successfully
implemented and validated through extensive testing, confirming that the
system meets the intended objectives in terms of data integrity, consistency, and
performance.

The following outcomes were achieved:

Successful Creation of Core Database Tables:


The primary tables (books, students, admins, and borrow_records)
were created without errors, with appropriate primary key and foreign key
constraints ensuring structural integrity and relational consistency.

Accurate Enforcement of Data Integrity Constraints:


Data integrity was upheld through the use of primary keys, unique constraints
(e.g., on student emails and admin usernames), not-null constraints for
mandatory fields, and foreign keys to enforce relationships between tables.

Correct Execution of CRUD Operations:


Create, Read, Update, and Delete operations were systematically tested across
all entities. Data insertion, updates, retrieval, and deletion behaved as expected
without causing anomalies or violating integrity rules.

Secure Management of Authentication Data:


Administrative user authentication was securely implemented, with passwords
hashed using bcrypt before storage, ensuring that sensitive information is
protected according to database security best practices.

Atomicity and Consistency in Borrow and Return Transactions:


Borrowing and returning books involved correct atomic updates:When a book
was issued, the available quantity decreasedUpon return, the available quantity
increased accordingly. Transactions maintained consistent states in the database,
aligning with ACID principles.
Efficient Query Performance:
Retrieval operations, including those involving JOIN queries between
borrow_records, books, and students, demonstrated fast response
times. PostgreSQL's internal indexing on primary keys contributed to efficient
data access.

Correct Behavior of Cascading Deletes:


Referential actions such as ON DELETE CASCADE were tested successfully.
Deletion of a student or a book automatically removed all associated borrow
records, maintaining database consistency without manual intervention.

Scalability and Extensibility of the Database Design:


The normalized schema structure allows for future enhancements (such as
tracking overdue books, adding book reservation features, or implementing
more detailed borrowing policies) without the need for major modifications.
CHALLENGES
During the development and deployment of the relational database for the
Book Management System, several theoretical and practical challenges were
encountered. These challenges primarily concerned database design,
integrity enforcement, security, and performance optimization.

The following challenges were identified:

Maintaining Data Integrity Across Related Tables:


Designing a relational database requires strict enforcement of referential
integrity between interconnected entities such as books, students, and borrow
records. Ensuring that all borrow records reference valid students and books
posed a significant challenge, particularly when managing deletions and
updates.

Handling Concurrency in Transactional Operations:


In scenarios where multiple users interact with the system simultaneously,
ensuring atomic and consistent borrow and return operations becomes
critical. Preventing data anomalies such as negative stock levels during
concurrent updates required careful transaction management planning.

Implementing Secure Authentication Mechanisms:


Storing user credentials securely within the database was a key concern. The
challenge involved adopting a robust password hashing strategy to protect
administrative accounts against unauthorized access and potential data
breaches.

Managing Cascading Effects of Deletions:


Ensuring that deletions of parent records (such as students or books) did not
leave orphaned borrow records was challenging. Deciding between
automatic cascading deletions and preserving historical transactional data
required careful schema design considerations.
Optimizing Query Performance for Efficient Data Retrieval:
As data volume increased, maintaining efficient query response times,
especially for operations involving multiple table joins and searches, became
increasingly complex. Proper indexing and query optimization strategies
were essential to address potential performance bottlenecks.

Preventing Data Redundancy and Duplication:


Avoiding the insertion of duplicate records, particularly in fields like student
emails and admin usernames, necessitated the application of appropriate
constraints to ensure the uniqueness and accuracy of critical data fields.

Testing and Validation of Database Operations:


Comprehensive testing of database operations, including edge cases such as
overdue borrowing and incomplete returns, was essential to validate the
system’s stability. Designing thorough validation procedures and manual
verification strategies presented logistical challenges during the testing
phase.
SOURCES

Rela%onal Database Theory:


The fundamental structure of the database, including tables, primary keys,
foreign keys, and en+ty rela+onships, was based on the principles outlined in E.
F. Codd's rela+onal model. Concepts such as normaliza+on, referen+al integrity,
and rela+onal algebra provided the basis for structuring and querying the data
effec+vely.

Database Normaliza%on:
The process of organizing the database schema to minimize redundancy and
dependency was inspired by tradi+onal normaliza+on forms (1NF, 2NF, 3NF)
discussed in academic textbooks such as "Database System Concepts" by
Silberschatz, Korth, and Sudarshan.

SQL Language and PostgreSQL Standards:


The Structured Query Language (SQL) syntax used to create tables, insert
records, and enforce constraints followed the ANSI SQL standards, adapted
specifically for PostgreSQL, an advanced open-source rela+onal database
system

You might also like