Count overdue installments by ageing bucket
Collections reports unpaid installments by how long they have been overdue, as of a fixed reporting date of 2026-06-30.
An installment is unpaid when paid_date is null. Days past due is the number of days from its due_date to the reporting date; anything not yet at least 1 day overdue is out of scope.
Return bucket and loan_count for all four buckets in dpd_buckets, including any bucket with no installments in it, ordered by the bucket's sort_order.
Schema
| bucket | TEXT |
| sort_order | INT |
| min_days | INT |
| max_days | INT |
| installment_id | INT |
| borrower | TEXT |
| due_date | DATE |
| paid_date | DATE |
Basic
The example input, expected output, and walkthrough for this question unlock with a Basic plan.
Basic
The reference solution and walkthrough for this question unlock with a Basic plan.
Basic
This is a Basic question
Premium practice questions unlock with a Basic plan. The full solution, expected output, and grading are available to Basic members.
RM 25/mo · cancel anytime