Library Management System
Library Management System
1. User: Represents the users of the library system, which includes students, faculty, and librarians. Users are
required to log in to access the system.
2. Book: Represents the collection of books available in the library. Each book has unique attributes like title,
author, and book ID.
3. Category: Represents the categories to which books belong (e.g., Fiction, Science, History).
4. Issue: Tracks the information about books issued to users, including issue and return dates.
5. Request: Represents the requests made by users for books that are not currently available.
6. Event: Represents workshops or other events conducted by or near the library, with detailed information
stored.
7. Admin: Represents the librarian or administrator responsible for managing the system, including adding or
removing books and users.
Functional Requirements
1. User Login:
o Users can log in using their unique ID and password.
o Only valid credentials are allowed, and users can log out when finished.
o The system authorizes access based on the user role (student, faculty, librarian).
2. Register New User:
o The system allows the registration of new users.
o Information provided during registration is verified for accuracy.
o Invalid or duplicate data cannot be stored.
3. Book Management:
o Admins can add new books with details like title, author, publication, and category.
o Books with duplicate IDs are not allowed.
4. Search Books:
o Users can search for books by title, author, category, or keywords.
o The system filters results based on the entered criteria and displays them.
5. Issue and Return Books:
o Users can issue books, with the system updating availability and issue information.
o Return dates are recorded, and overdue notifications are generated.
o The system ensures a book is available before issuing.
6. Event Management:
o Admins and users can add and view events like workshops or book fairs.
o Events are displayed on a notice board on the system homepage.
7. User Profile Management:
o Users can update their profiles and view their issued books and pending dues.
8. Request Books:
o Users can request unavailable books.
o Librarians review and approve/reject requests based on availability.
Non-Functional Requirements
1. Usability Requirements:
o The system interface must be user-friendly and intuitive.
o Both users and admins should easily navigate the system with minimal training.
2. Error Handling:
o The system should gracefully handle errors like invalid login attempts, duplicate book entries, or
database connection issues.
3. Security Requirements:
o Only authorized admins can modify or delete book and user records.
o All user data, including passwords, must be securely encrypted.
4. Performance Requirements:
o The system must handle at least 500 concurrent users and 1000 requests per minute.
o System downtime must be minimal, with proper backups in place.
2. Book Table
• Description: Stores information about all books in the library.
• Attributes:
Attribute Name Data Type Constraints
book_id INT PRIMARY KEY, AUTO_INCREMENT
title VARCHAR(200) NOT NULL
author VARCHAR(100) NOT NULL
publication VARCHAR(100) NULL
category_id INT FOREIGN KEY REFERENCES category(category_id)
total_copies INT NOT NULL
available_copies INT NOT NULL
3. Category Table
• Description: Stores information about book categories.
• Attributes:
Attribute Name Data Type Constraints
category_id INT PRIMARY KEY, AUTO_INCREMENT
name VARCHAR(50) NOT NULL, UNIQUE
4. Issue Table
• Description: Tracks the issuing of books by users.
• Attributes:
Attribute Name Data Type Constraints
issue_id INT PRIMARY KEY, AUTO_INCREMENT
user_id INT FOREIGN KEY REFERENCES user(user_id)
book_id INT FOREIGN KEY REFERENCES book(book_id)
issue_date DATE NOT NULL
due_date DATE NOT NULL
return_date DATE NULL
fine DECIMAL(5, 2) DEFAULT 0.00
5. Request Table
• Description: Tracks book requests made by users.
• Attributes:
Attribute Name Data Type Constraints
request_id INT PRIMARY KEY, AUTO_INCREMENT
user_id INT FOREIGN KEY REFERENCES user(user_id)
book_id INT FOREIGN KEY REFERENCES book(book_id)
request_date DATE NOT NULL
status ENUM('Pending', 'Approved', 'Rejected') DEFAULT 'Pending'
6. Admin Table
• Description: Stores information about system administrators (librarians).
• Attributes:
Attribute Name Data Type Constraints
admin_id INT PRIMARY KEY, AUTO_INCREMENT
user_id INT FOREIGN KEY REFERENCES user(user_id)
privileges TEXT NOT NULL
7. Event Table
• Description: Stores details of events conducted by or near the library.
• Attributes:
Attribute Name Data Type Constraints
event_id INT PRIMARY KEY, AUTO_INCREMENT
title VARCHAR(100) NOT NULL
description TEXT NOT NULL
event_date DATE NOT NULL
admin_id INT FOREIGN KEY REFERENCES admin(admin_id)
Relationships:
1. User ↔ Issue: One-to-Many (A user can issue multiple books).
2. Book ↔ Issue: One-to-Many (A book can be issued multiple times).
3. User ↔ Request: One-to-Many (A user can request multiple books).
4. Book ↔ Request: One-to-Many (A book can be requested by multiple users).
5. Category ↔ Book: One-to-Many (A category can have multiple books).
6. Admin ↔ Event: One-to-Many (An admin can organize multiple events).
Member Borrowing
+ borrowBook(bookCopy:
BookCopy): void + extendDueDate(days: int): void
+ returnBook(borrowing:
Borrowing): void
Transaction
LibraryStaff Student
- staffID: int
- position: String - transactionID: int
- studentID: String - transactionDate: Date
- department: String
+ manageBooks(): void
+ manageMembers(): void
+ issueBook(member: Member,
+ reserveBook(book: Book): void bookCopy: BookCopy): void
+ cancelReservation(book: Book): void + returnBook(borrowing: Borrowing):
+ payFine(amount: double): void void
1. User Table
3. Category Table
category_id name
1 History
2 Science
3 Languages
4 Technology
5 Law
4. Issue Table
5. Request Table
7. Event Table
501 Book Fair 2025 Annual Book Fair at OOU 2025-02-15 401
8. Department Table
department_id name
1 History
2 Computer Science
3 Yoruba Studies
4 Engineering
5 Law
user_id department_id
1 1
2 3
3 4
5 2
1. User Table
From the entity User, we create a relational table to hold user details.
2. Book Table
From the entity Book, we create a relational table with a foreign key to Category.
3. Category Table
From the entity Category, we create a relational table for book categories.
4. Issue Table
From the relationship between User and Book, we create a table for issued books.
5. Request Table
From the relationship between User and Book, we create a table for book requests.
CREATE TABLE Request (
request_id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
book_id INT NOT NULL,
request_date DATE NOT NULL,
status ENUM('Pending', 'Approved', 'Rejected') DEFAULT 'Pending',
FOREIGN KEY (user_id) REFERENCES User(user_id),
FOREIGN KEY (book_id) REFERENCES Book(book_id)
);
6. Admin Table
7. Event Table
From the entity Event, we create a table with a foreign key to Admin.
8. Department Table
From the relationship between User and Department, we create a mapping table.
E-R DIAGRAM