Finance & FP&AMedium

Write SQL to compute AR aging buckets by customer.

Seen at: Stripe · Brex · Ramp · JPMorgan

Given an invoices table with columns (invoice_id, customer_id, amount, invoice_date, paid_date), write SQL that produces for each customer: total outstanding AR in 0–30, 31–60, 61–90, and 90+ day buckets. Unpaid invoices have paid_date IS NULL.

Draft your answer

Saved to this browser only. Try it before you peek at the model answer.

Stuck? Peek at a hint

Reveals the model answer and the self-score rubric.

More finance & fp&a questions