Library Schema Explorer
What you're building
A query that identifies currently overdue loans β books that were borrowed but never returned. The kind of report a librarian runs every morning.
Requirements
Return a list of currently active loans (where return_date IS NULL) with:
member_nameβ the borrowing member's namebook_titleβ the book's titlegenreβ the book's genreloan_dateβ when it was checked out
Order by loan_date ascending (oldest loans first).
Tables: members(id, name, city) Β· books(id, title, author, genre, year) Β· loans(id, member_id, book_id, loan_date, return_date)
Stretch goals
- Add a count of how many books each member currently has out.
- Filter to only
'Sci-Fi'books still on loan.
What this proves
NULL handling, multi-table joins, and real-world schema reasoning β skills that show up in every backend and data role.
β‘ 50 XP
query.sqlRuns in your browser (SQLite/WASM)
Loading editorβ¦
Tests1 to pass
Unreturned books with member and title, oldest first
Run your code to check these.