Late Fees per Member
Medium
Library Systems
Each full day a book is returned after its due date costs 5. Compute the total late fee per member (only members with a fee above 0), ordered by member_id.
Table schema
Loans(id INT PRIMARY KEY, member_id INT, due_date DATE, returned_date DATE)Sample data
id | member_id | due_date | returned_date
1 | 1 | 2026-03-01 | 2026-03-04
2 | 1 | 2026-03-10 | 2026-03-10
3 | 2 | 2026-03-05 | 2026-03-07
4 | 2 | 2026-03-12 | 2026-03-11
5 | 3 | 2026-03-01 | 2026-03-01
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.