0% found this document useful (0 votes)
94 views10 pages

Library Management System

The Library Management System includes entities such as Users, Books, Categories, Issues, Requests, Events, and Admins, with defined relationships among them. Functional requirements encompass user login, book management, event management, and user profile management, while non-functional requirements focus on usability, error handling, security, and performance. The document also outlines the database catalog and E-R diagram for the system's relational model.

Uploaded by

Daniel Akinwande
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)
94 views10 pages

Library Management System

The Library Management System includes entities such as Users, Books, Categories, Issues, Requests, Events, and Admins, with defined relationships among them. Functional requirements encompass user login, book management, event management, and user profile management, while non-functional requirements focus on usability, error handling, security, and performance. The document also outlines the database catalog and E-R diagram for the system's relational model.

Uploaded by

Daniel Akinwande
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/ 10

LIBRARY MANAGEMENT SYSTEM

Entities in 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.

Relationships Between Entities

1. User and Book:


o Users can issue multiple books, forming a one-to-many relationship between User and Issue.
o Users can request multiple books, establishing a one-to-many relationship between User and
Request.
2. Book and Category:
o A book belongs to a single category, but a category can have multiple books, establishing a one-to-
many relationship.
3. Issue and Book:
o An issued record is associated with one book, but a book can have multiple issues over time.
4. Admin and User:
o The admin can add, update, or delete user records, establishing a dependent relationship.
5. Event and Admin:
o Admins can create multiple events, forming a one-to-many relationship.

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.

Database Catalog for Library Management System


1. User Table
• Description: Stores information about all users (students, faculty, librarians).
• Attributes:
Attribute Name Data Type Constraints
user_id INT PRIMARY KEY, AUTO_INCREMENT
first_name VARCHAR(50) NOT NULL
last_name VARCHAR(50) NOT NULL
email VARCHAR(100) UNIQUE, NOT NULL
password VARCHAR(255) NOT NULL
role ENUM('Student', 'Faculty', 'Librarian') NOT NULL
phone_no VARCHAR(15) NULL
address TEXT NULL

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).

Relationship in Library Management

Library Book BookCopy


- name: String
- address: String
- title: String
- author: String - copyID: int
- ISBN: String - status: String
+ addBook(): void - category: String
+ removeBook(): void

+ getTransactionID(): int + checkStatus(): void


+ getDate(): Date + updatetatus(): void
+ getAmount(): double
+ getType(): String

Member Borrowing

- memberID: int - borrowingID: int


- borrowDate: Date
- name: String - dueDate: Date
- contactInfo: String - returnDate: Date

+ 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

user_id first_name last_name email password role phone_no address

1 Daniel Akinwande [email protected] pass1234 Student 08123456789 Akoka, Lagos

2 Sunmisire Thomas [email protected] smi9876 Faculty 07098765432 Surulere, Lagos

3 David Osubor [email protected] Student 08012349876 Ikeja, Lagos

4 Qudus Adebowale [email protected] tun6543 Librarian 08145678901 Yaba, Lagos

5 Bosuro Ayomide [email protected] adepass99 Faculty 09087654321 Magodo, Lagos


2. Book Table

book_id title author publication category_id total_copies available_copies

101 Introduction to Nigerian


Adebowale S. University Press1 10 7
History

102 Advanced Mathematics


Daniel OlawaleTechBooks 2 15 10
for Engineers Publishers

103 Fundamentals of Yoruba


Sunmisire B. Heritage Press 3 8 5
Language

104 Computer Science Basics


David AyomideLagos Press 4 12 8

105 Nigerian Legal Studies


Tunde AdebisiJudicial Publishers
5 6 4

3. Category Table

category_id name

1 History

2 Science

3 Languages

4 Technology

5 Law

4. Issue Table

issue_id user_id book_id issue_date due_date return_date fine

201 1 101 2025-01-01 2025-01-15 NULL 0.00

202 3 104 2025-01-05 2025-01-20 NULL 0.00

203 2 103 2024-12-10 2024-12-24 2024-12-22 0.00

204 1 102 2025-01-02 2025-01-16 NULL 0.00

5. Request Table

request_id user_id book_id request_date status

301 1 105 2025-01-08 Pending

302 3 103 2025-01-10 Approved

303 2 102 2025-01-05 Rejected


6. Admin Table

admin_id user_id privileges

401 4 Manage Users, Books

7. Event Table

event_id title description event_date admin_id

501 Book Fair 2025 Annual Book Fair at OOU 2025-02-15 401

502 Tech Workshop Coding skills for beginners 2025-03-10 401

503 History Seminar Nigeria in the Pre-Colonial Era 2025-04-05 401

8. Department Table

department_id name

1 History

2 Computer Science

3 Yoruba Studies

4 Engineering

5 Law

9. User-Department Mapping Table

This table links users to departments.

user_id department_id

1 1

2 3

3 4

5 2

E-R Diagram to Relational Model Conversion

1. User Table

From the entity User, we create a relational table to hold user details.

CREATE TABLE User (


user_id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
role ENUM('Student', 'Faculty', 'Librarian') NOT NULL,
phone_no VARCHAR(15),
address TEXT
);

2. Book Table

From the entity Book, we create a relational table with a foreign key to Category.

CREATE TABLE Book (


book_id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(200) NOT NULL,
author VARCHAR(100) NOT NULL,
publication VARCHAR(100),
category_id INT NOT NULL,
total_copies INT NOT NULL,
available_copies INT NOT NULL,
FOREIGN KEY (category_id) REFERENCES Category(category_id)
);

3. Category Table

From the entity Category, we create a relational table for book categories.

CREATE TABLE Category (


category_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL UNIQUE
);

4. Issue Table

From the relationship between User and Book, we create a table for issued books.

CREATE TABLE Issue (


issue_id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
book_id INT NOT NULL,
issue_date DATE NOT NULL,
due_date DATE NOT NULL,
return_date DATE,
fine DECIMAL(5,2) DEFAULT 0.00,
FOREIGN KEY (user_id) REFERENCES User(user_id),
FOREIGN KEY (book_id) REFERENCES Book(book_id)
);

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

From the entity Admin, we create a table with privileges.

CREATE TABLE Admin (


admin_id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
privileges TEXT NOT NULL,
FOREIGN KEY (user_id) REFERENCES User(user_id)
);

7. Event Table

From the entity Event, we create a table with a foreign key to Admin.

CREATE TABLE Event (


event_id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100) NOT NULL,
description TEXT NOT NULL,
event_date DATE NOT NULL,
admin_id INT NOT NULL,
FOREIGN KEY (admin_id) REFERENCES Admin(admin_id)
);

8. Department Table

From the entity Department, we create a table for university departments.

CREATE TABLE Department (


department_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL
);

9. User-Department Mapping Table

From the relationship between User and Department, we create a mapping table.

CREATE TABLE User_Department (


user_id INT NOT NULL,
department_id INT NOT NULL,
PRIMARY KEY (user_id, department_id),
FOREIGN KEY (user_id) REFERENCES User(user_id),
FOREIGN KEY (department_id) REFERENCES Department(department_id)
);

E-R DIAGRAM

You might also like