0% found this document useful (0 votes)
11 views

Library Managment System

A full presentation for this topic

Uploaded by

malikfurqan7045
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Library Managment System

A full presentation for this topic

Uploaded by

malikfurqan7045
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Library management

system
:Submitted by
Muhammad Furqan(1022)
:Submitted to
Mr.Amir jamshed
Department of computer science
:Content
Introduction
DFD(Level.0 & Level.1)
ER Diagram
Normalization
SQL Code
What is a Library Management System?
 A Library Management System (LMS) is software designed to manage all the functions of
a library.
 Helps librarians to maintain the database of new books, track borrowed books, and their
due dates, and manage members.
Objectives
• Efficient management of book records and member information.
• Streamline the process of issuing, returning, and reserving books.
• Improve accessibility and user experience for both librarians and members.
Features of Library Management System:
 Book Management: Cataloging, Searching, Issuing, Returning, Reserving books.
 Member Management: Registration, Tracking borrowing history, Notifications.
 Staff Management: Roles and permissions, Librarian activities.
 Reports and Analytics: Overdue books, Popular books, Member activity.

Data Flow Diagram (DFD):


Level 0 DFD (Context Diagram)
Shows the interaction between the system and external entities such as Librarian,
Members, and the Database.
Level 1 DFD:
Breaks down the main processes such as Book Management, Member
Management, and Transaction Management.
 DFD Diagram:

(view the book details)


 User register
Administr
LMS Student
ator
 Read and write  Book request

 Library database
Entity-Relationship Diagram (ERD)
 Illustrates the entities involved in the system and their relationships.
Key Entities:
 Book: Attributes - Book_ID, Title, Author, ISBN, Publisher, Year.
 Member: Attributes - Member_ID, Name, Address, Phone, Email.
 Transaction: Attributes - Transaction_ID, Member_ID, Book_ID, Issue_Date, Due_Date,
Return_Date.
 Librarian: Attributes - Librarian_ID, Name, Email, Password.
Level 0 DFD (Context Diagram)
The Level 0 DFD provides a high-level overview of the entire system, showing the system as a single
process with its relationships to external entities.
Entities:
1. Member
2. Staff
3. Admin
Process: Library Management System
Data Stores:
4. Books Database
5. Members Database
6. Staff Database
7. Loans Database
Level 1 DFD
The Level 1 DFD breaks down the main process into sub-processes.
Sub-processes:
8. Manage Books
9. Manage Members
10. Manage Loans
11. Manage Staff
Data Flows:
Between entities and processes
Between processes and data stores
Let me create the diagrams.
Level 0 DFD
Here is the text representation of the Level 0 DFD:
sql
+-----------------+ +-----------------+
| Member | | Staff |
|-----------------| |-----------------|
| - Request Book | | - Issue/Return |
+--------|--------+ +--------|--------+
| |
| |
| |
v v
+----------------------------------------+
| Library Management System |
|----------------------------------------|
| - Manage Books |
| - Manage Members |
| - Manage Loans |
| - Manage Staff |
+-----------------|----------------------+
|
|
v
+-----------------+
| Admin |
|-----------------|
| - Add/Remove |
| - Update |
+-----------------+

Level 1 DFD
Here is the text representation of the Level 1 DFD:
sql
+-----------------+ +-----------------+ +-----------------+
| Member | | Staff | | Admin |
|-----------------| |-----------------| |-----------------|
| - Request Book | | - Issue/Return | | - Add/Remove |
+--------|--------+ +--------|--------+ | - Update |
| | +--------|--------+
| | |
v v v
+---------------------------------------------------------------+
| Library Management System |
|---------------------------------------------------------------|
| - Manage Books | - Manage Loans |
| - Add/Remove Books | - Issue Books |
| - Search Books | - Return Books |
| | |
| - Manage Members | - Manage Staff |
| - Register/Remove Members | - Add/Remove Staff |
| - Update Member Details | - Update Staff Details |
+----------------|--------------+----|--------------------------+
| |
v v
+--------------+ +--------------+
| Books DB | | Loans DB |
+--------------+ +--------------+
| Members DB | | Staff DB |
+--------------+ +--------------+
Book ID Author Pub_ID

Address
Title
Books Published
by Publisher

Name

Price

Availability
 ER Diagram:
Exp_Date

Name

Relatio
Due Date
nship Member Address

Memb_type
Memb_Id

Return Date
Issue Memb _info
:Normalization

Step 1: Identify the Main Entities and Attributes


:Initially, we have
Users: UserID, UserName, UserEmail, UserPhone, UserAddress
Books: BookID, Title, Author, Publisher, YearPublished, ISBN, Category
Loans: LoanID, UserID, BookID, LoanDate, ReturnDate
Reservations: ReservationID, UserID, BookID, ReservationDate
Step 2: First Normal Form (1NF)
Ensure that all columns have atomic values and each record is unique
Borrow date Book Name Book ID Student Name Student ID

30-01-2024 History #10 Ali 001

15-04-2024 Maths #20 Ahmad 002

09-05-2024 Biology #50 Sana 003

31-12-2023 English #100 Alia 004

15-12-2023 Statestics #30 Arslan 005


Step 3: Second Normal Form (2NF)
Ensure that all non-key attributes are fully functional dependent on the primary key. Since
.we already have simple primary keys, we don't need any changes for 2NF

Student Name Student_ID Book Name Book ID

Ali 001 History #10

Ahmad 002 Maths #20

Sana 003 Biology #50

Alia 004 English #100

Arslan 005 Statestics #30


Step 4: Third Normal Form (3NF)
Ensure that all attributes
are only dependent on the primary key (no
transitive dependency). We should look at the
attributes again and see if any non-key attribute is
dependent on another non-key attribute.
Create Table in SQL server

Create Users Table --


( CREATE TABLE Users
,UserID INT PRIMARY KEY AUTO_INCREMENT
,UserName VARCHAR(100) NOT NULL
,UserEmail VARCHAR(100) NOT NULL UNIQUE
,UserPhone VARCHAR(15) NOT NULL
UserAddress VARCHAR(255) NOT NULL
;)
-- Create Books Table
CREATE TABLE Books (
BookID INT PRIMARY KEY AUTO_INCREMENT,
Title VARCHAR(255) NOT NULL,
Author VARCHAR(100) NOT NULL,
Publisher VARCHAR(100) NOT NULL,
YearPublished YEAR NOT NULL,
ISBN VARCHAR(13) NOT NULL UNIQUE,
Category VARCHAR(50) NOT NULL
);
-- Create Loans Table
CREATE TABLE Loans (
LoanID INT PRIMARY KEY AUTO_INCREMENT,
UserID INT NOT NULL,
BookID INT NOT NULL,
LoanDate DATE NOT NULL,
ReturnDate DATE,
FOREIGN KEY (UserID) REFERENCES Users(UserID),
FOREIGN KEY (BookID) REFERENCES Books(BookID)
);
-- Create Reservations
Table CREATE TABLE Reservations (
ReservationID INT PRIMARY KEY AUTO_INCREMENT,
UserID INT NOT NULL,
BookID INT NOT NULL,
ReservationDate DATE NOT NULL,
FOREIGN KEY (UserID) REFERENCES Users(UserID),
FOREIGN KEY (BookID) REFERENCES Books(BookID)
);
-- Insert Sample Data
INSERT INTO Users (UserName, UserEmail, UserPhone, UserAddress) VALUES
('Alice', '[email protected]', '1234567890', '123 Main St.'),
('Bob', '[email protected]', '0987654321', '456 Elm St.');
INSERT INTO Books (Title, Author, Publisher, YearPublished, ISBN, Category) VALUES
('Book A', 'Author A', 'Publisher A', 2020, '1234567890123', 'Fiction'),
('Book B', 'Author B', 'Publisher B', 2019, '9876543210987', 'Non-Fiction');

INSERT INTO Loans (UserID, BookID, LoanDate, ReturnDate) VALUEs


(1, 1, '2024-06-01', '2024-06-15'),
(2, 2, '2024-06-05', '2024-06-20');

INSERT INTO Reservations (UserID, BookID, ReservationDate) VALUES


(1, 2, '2024-06-10'),
(2, 1, '2024-06-12');

 THE END..

You might also like