Overdue Unreturned Books
Easy
Library Systems
Today is 2026-10-01. Return the loan id of every book that has not been returned (returned_date IS NULL) and whose due date is before today, ordered by id.
Table schema
Loans(id INT PRIMARY KEY, member_id INT, book_id INT, due_date DATE, returned_date DATE)Sample data
id | member_id | book_id | due_date | returned_date
1 | 1 | 10 | 2026-09-20 | NULL
2 | 2 | 11 | 2026-09-25 | 2026-09-24
3 | 3 | 12 | 2026-10-05 | NULL
4 | 1 | 13 | 2026-09-10 | NULL
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.