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

Database Prog

The document describes a library management system (LMS) that manages library operations through a database. The LMS allows users to search for books, place holds, borrow and return books. It also sends reminders and tracks borrowing history. Entities in the database include members, books, loans, reservations and fines. Relationships between entities are shown in an entity relationship diagram.

Uploaded by

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

Database Prog

The document describes a library management system (LMS) that manages library operations through a database. The LMS allows users to search for books, place holds, borrow and return books. It also sends reminders and tracks borrowing history. Entities in the database include members, books, loans, reservations and fines. Relationships between entities are shown in an entity relationship diagram.

Uploaded by

shams FCAI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

‫‪Library Management System‬‬

‫)‪(LMS‬‬

‫الرقم الجامعي‬ ‫االسم‬


‫‪421000494‬‬ ‫وجدان سعود الشمري‬
‫‪431002125‬‬ ‫شذى مقرن المطيري‬
‫‪431002022‬‬ ‫هبه الرميش العطوي‬
‫‪391003166‬‬ ‫اروى محفوظ البلوي‬
‫‪431003395‬‬ ‫تهاني سعيد القاسمي‬
‫‪421004002‬‬ ‫ندى خلف العنزي‬
❑ Description
The Library Management System (LMS) is a comprehensive database
system designed to efficiently manage the operations of a library or
information center. It provides a user-friendly interface for members to
access and interact with the library's resources. Here is a description of the
key features and functionalities of the LMS:
1. User Management:
The system allows administrators to register and manage member
accounts. Members can create their profiles, including personal
information such as name, contact details, and membership status.

2. Catalog Management:
The LMS maintains a database of all available books, materials, and
resources in the library. Each item is categorized and tagged with relevant
metadata such as title, author, ISBN, publication date, and genre.

3. Search and Discovery:


Members can easily search and browse the library's catalog using various
criteria, including title, author, keyword, or category. The system
provides advanced search capabilities to quickly locate specific items.

4. Borrowing and Renewal:


Members can request to borrow items from the library through the
system. The LMS manages the loan process, including checking item
availability, assigning due dates, and generating borrowing receipts.
Members can also request renewals for borrowed items if permitted by
the library's policies.
5. Reservation and Holds:
The system supports reservations and holds for items that are currently
unavailable. Members can place holds on desired items, and the system
notifies them when the items become available for pickup.

6. Loan Management:
The LMS tracks the loan history and status of each item, including
check-out and check-in dates, overdue notifications, and fines for late
returns. It automatically updates the availability status of items based on
loan transactions.

7. Notifications and Reminders:


The system sends notifications and reminders to members for upcoming
due dates, overdue items, reservation pickups, and other important
events. This helps members stay informed and manage their borrowing
activities effectively.

8. Reporting and Analytics:


Administrators can generate reports and analytics on various aspects of
library operations, such as circulation statistics, inventory management,
member engagement, and resource utilization. This data-driven insights
help optimize library services and resources.

Overall, the Library Management System streamlines library


operations, enhances member experience, and promotes efficient
resource utilization, ultimately contributing to the success and
effectiveness of the library or information center.
❑ Database design: Entities
1. Member:
▪ Represents individuals who are registered members of the library. They can
borrow and return books, search the catalog, and manage their account
information.

Member
Member ID (Primary Key)
Name

Contact Information

Address
Membership Status

2. Book:
▪ Represents individual books available in the library's collection. Contains
information about each book's title, author, genre, and availability status. It allows
members to search for and borrow books.

Book
Book ID (Primary Key)
Title

Author

ISBN
Genre

Publication Date

Availability Status
3. Loan:
▪ Tracks the borrowing history of books by members. Contains information about
loans, including the member who borrowed the book, the book borrowed, loan
date, due date, and return date.

Loan
Loan ID (Primary Key)
Member ID (FK)

Book ID(FK)

Loan Date
Due Date

Return Date

4. Reservation:
▪ Manages reservations placed by members for books that are currently
unavailable. Tracks reservation details such as the member who placed the
reservation, the book reserved, reservation date, and pickup date.

Reservation
Reservation ID (Primary Key)
Member ID (FK)

Book ID(FK)

Reservation Date
Pickup Date
5. Notification:
▪ Stores notifications sent to members regarding due dates, overdue items,
reservation pickups, and other important events. Contains information about the
recipient member, message content, and timestamp of the notification.

Notification
Notification ID (Primary Key)
Member ID (FK)

Message

Timestamp

6. Administrator:
▪ Represents administrators who have access to system management functions
such as adding new books, managing member accounts, generating reports, and
configuring system settings.

Administrator
Admin ID (Primary Key)
Username

Password
7. Fine:
▪ Represents fines imposed on members for overdue items or other violations of
library policies. Contains information about the loan associated with the fine, the
amount of the fine, and the reason for the fine..

Fine
Fine ID (Primary Key)
Loan ID (FK)

Amount

Reason

8. Author:
▪ Represents authors of books available in the library's collection. Contains
information about the author's name, biography, and nationality. It is associated
with the Book entity to identify the authors of each book.

Author
Author ID (Primary Key)
Name

Biography

Nationality
9. Genre:
▪ Represents categories or genres of books available in the library's collection.
Contains information about each genre's name and description. It is associated
with the Book entity to classify books based on their genre.

Genre
Genre ID (Primary Key)
Name

Description

10. Library Branch:


▪ Represents physical branches or locations of the library. Contains information
about each branch's name, address, and contact information. It is associated with
the Book entity to track the availability of books at each branch.

Library Branch
Branch ID (Primary Key)
Name

Address

Contact Information
❑ ERD
❑ Implement DataBase by SQL

 CREATE TABLE Member (


MemberID INT PRIMARY KEY,
Name VARCHAR(100),
ContactInformation VARCHAR(100),
Address VARCHAR(255),
MembershipStatus VARCHAR(50)
);

INSERT INTO Member (MemberID, Name, ContactInformation, Address,


MembershipStatus)
VALUES
(1, 'John Doe', '[email protected]', '123 Main St, Cityville', 'Active'),
(2, 'Jane Smith', '[email protected]', '456 Elm St, Townsville',
'Active'),
(3, 'Alice Johnson', '[email protected]', '789 Oak St, Villagetown',
'Active');
 CREATE TABLE Book (
BookID INT PRIMARY KEY,
Title VARCHAR(255),
Author VARCHAR(100),
ISBN VARCHAR(20),
Genre VARCHAR(50),
PublicationDate DATE,
AvailabilityStatus VARCHAR(50)
);

INSERT INTO Book (BookID, Title, Author, ISBN, Genre, PublicationDate,


AvailabilityStatus)
VALUES
(1, 'To Kill a Mockingbird', 'Harper Lee', '9780061120084', 'Fiction', '1960-
07-11', 'Available'),
(2, '1984', 'George Orwell', '9780451524935', 'Science Fiction', '1949-06-08',
'Available'),
(3, 'The Great Gatsby', 'F. Scott Fitzgerald', '9780743273565', 'Fiction',
'1925-04-10', 'Available');
 CREATE TABLE Loan (
LoanID INT PRIMARY KEY,
MemberID INT,
BookID INT,
LoanDate DATE,
DueDate DATE,
ReturnDate DATE,
FOREIGN KEY (MemberID) REFERENCES Member(MemberID),
FOREIGN KEY (BookID) REFERENCES Book(BookID)
);

INSERT INTO Loan (LoanID, MemberID, BookID, LoanDate, DueDate,


ReturnDate)
VALUES
(1, 1, 1, '2024-03-15', '2024-03-29', '2024-03-28'),
(2, 2, 2, '2024-03-20', '2024-04-03', NULL);
 CREATE TABLE Reservation (
ReservationID INT PRIMARY KEY,
MemberID INT,
BookID INT,
ReservationDate DATE,
PickupDate DATE,
FOREIGN KEY (MemberID) REFERENCES Member(MemberID),
FOREIGN KEY (BookID) REFERENCES Book(BookID)
);

INSERT INTO Reservation (ReservationID, MemberID, BookID,


ReservationDate, PickupDate)
VALUES
(1, 3, 3, '2024-03-25', '2024-03-28');
 CREATE TABLE Notification (
NotificationID INT PRIMARY KEY,
MemberID INT,
Message TEXT,
Timestamp TIMESTAMP,
FOREIGN KEY (MemberID) REFERENCES Member(MemberID)
);

INSERT INTO Notification (NotificationID, MemberID, Message,


Timestamp)
VALUES
(1, 1, 'Your book is due soon. Please return it by the due date.',
CURRENT_TIMESTAMP),
(2, 2, 'Your reservation is ready for pickup.', CURRENT_TIMESTAMP);
 CREATE TABLE Administrator (
AdminID INT PRIMARY KEY,
Username VARCHAR(50),
Password VARCHAR(50)
);

INSERT INTO Administrator (AdminID, Username, Password)


VALUES
(1, 'admin1', 'password123');
 CREATE TABLE Fine (
FineID INT PRIMARY KEY,
LoanID INT,
Amount DECIMAL(10, 2),
Reason VARCHAR(255),
FOREIGN KEY (LoanID) REFERENCES Loan(LoanID)
);

INSERT INTO Fine (FineID, LoanID, Amount, Reason)


VALUES
(1, 2, 5.00, 'Overdue fine');
 CREATE TABLE Author (
AuthorID INT PRIMARY KEY,
Name VARCHAR(100),
Biography TEXT,
Nationality VARCHAR(100)
);

INSERT INTO Author (AuthorID, Name, Biography, Nationality)


VALUES
(1, 'Harper Lee', 'Harper Lee was an American novelist widely known for To
Kill a Mockingbird.', 'American'),
(2, 'George Orwell', 'George Orwell was an English novelist, essayist, and
critic.', 'English'),
(3, 'F. Scott Fitzgerald', 'F. Scott Fitzgerald was an American novelist and
short story writer.', 'American');
 CREATE TABLE Genre (
GenreID INT PRIMARY KEY,
Name VARCHAR(50),
Description TEXT
);

INSERT INTO Genre (GenreID, Name, Description)


VALUES
(1, 'Fiction', 'Books that present imaginary characters and events.'),
(2, 'Science Fiction', 'Books that explore futuristic settings, science, and
technology.');
 CREATE TABLE LibraryBranch (
BranchID INT PRIMARY KEY,
Name VARCHAR(100),
Address VARCHAR(255),
ContactInformation VARCHAR(100)
);

INSERT INTO LibraryBranch (BranchID, Name, Address,


ContactInformation)
VALUES
(1, 'Main Library', '101 Library Ave, Cityville', '[email protected]'),
(2, 'Branch Library', '202 Branch St, Townsville',
'[email protected]');
1. Select all books borrowed by a specific member and their due
dates:

SELECT Book.Title, Loan.DueDate


FROM Loan
JOIN Book ON Loan.BookID = Book.BookID
WHERE Loan.MemberID = 1;
2. List all unique genres across the library's collection:

SELECT Genre
FROM Book
UNION
SELECT Name
FROM Genre;
3. Group books by genre and count the number of books in each
genre:

SELECT Genre, COUNT(*) AS NumBooks


FROM Book
GROUP BY Genre;
4. Order books by publication date in descending order:
SELECT Title, PublicationDate
FROM Book
ORDER BY PublicationDate DESC;
5. Retrieve the biography of authors whose nationality is American:

SELECT Name, Biography


FROM Author
WHERE Nationality = 'American';

You might also like