Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Late Fees per Member

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.