Skip to main content
πŸ—„οΈ SQL Projects

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 name
  • book_title β€” the book's title
  • genre β€” the book's genre
  • loan_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.