The Library Management System
The Library Management System
manage the core aspects of a library, such as the storage, tracking, and retrieval of books,
managing author details, keeping track of borrowers, and monitoring the status of borrowed
books. This system organizes and efficiently handles data about books, authors, borrowers, and
borrowing transactions.
1. Books:
o BookID (Primary Key)
o Title
o Genre
o PublishedYear
o AuthorID (Foreign Key)
2. Authors:
o AuthorID (Primary Key)
o Name
o Email
3. Borrowers:
o BorrowerID (Primary Key)
o FullName
o Email
o Phone
4. BorrowedBooks:
o BorrowID (Primary Key)
o BookID (Foreign Key)
o BorrowerID (Foreign Key)
o BorrowDate
o ReturnDate
Relationships:
Tables:
Table Structure:
1. Get all book titles along with their genre using aliases for columns:
1. Calculate the age of the book based on PublishedYear (assume the current year is
2024):
2. List the names of the books and the borrower who had borrowed that book, in the
format “book borrowed by borrower”:
SELECT Title + ' borrowed by ' + FullName AS BookAndBorrower
FROM Books, Borrowers
Condition-Based Queries
SELECT Title
FROM Books
WHERE AuthorID = 1; -- Assuming J.K. Rowling has AuthorID 1
7. Display all fantasy books authored by a specific author (e.g., AuthorID 1):