Project Report
Project Report
AND ENGINEERING
1. ACKNOWLEDGEMENT
2. CERTIFICATE
3.
DESCRIPTION OF PROJECT
1.OBJECTIVE
2.THEORY
3.IMPLEMENTATION
4.RESULTS
5.CHALLENGES
4. SOURCES
ACKNOWLEDGEMENT
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.
STUDENT FACULTY
Aditya Bose Dr. Shailender Kumar
Aditya Chaturvedi
OBJECTIVE
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.
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.
3. Normalization
To avoid redundancy and anomalies, the database design follows normalization
principles, up to Third Normal Form (3NF):
• Example:
Borrow records store only student_id and book_id, not redundant student names or
book titles.
sql
CopyEdit
ALTER TABLE books
ADD CONSTRAINT positive_quantity CHECK (quantity >=
0);
6. Referential Integrity
By using Foreign Keys, the system ensures:
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.
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.
• 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;
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.