Library Management System
đĄ Overview
This project takes CRUD a step further into REAL schema design â multiple related tables, foreign keys, and the kind of many-to-many relationship (members borrowing many books over time) that shows up in almost every serious database.
â Features to Build
0/4 doneđ§ Step-by-Step Guide
Draw the ER diagram first: Books, Members, and IssuedBooks (with foreign keys to both).
Create the three tables with proper PRIMARY KEY and FOREIGN KEY constraints.
Insert sample books and members.
Write an INSERT into IssuedBooks whenever a book is 'issued', and a query with a JOIN to see who has which book.
Write an UPDATE to set a ReturnDate when a book is returned, and a query to find all currently un-returned books.
đ Starter Code
CREATE TABLE IssuedBooks (
IssueID INT PRIMARY KEY,
BookID INT,
MemberID INT,
IssueDate DATE,
ReturnDate DATE,
FOREIGN KEY (BookID) REFERENCES Books(BookID),
FOREIGN KEY (MemberID) REFERENCES Members(MemberID)
);đĄ Pro Tip
Design the ER diagram on paper BEFORE writing any SQL â most schema design mistakes happen because people jump straight to CREATE TABLE without first sketching the relationships.