Accounts that keep paying more

MediumPayPalmonthly averageslagbool_andhavinggroup comparison· 60 XP (20 per step)

Mock interview. You're interviewing for a risk analyst job on a payments team. The interviewer explains: "One fraud pattern is called ramping: an account starts with small payments, then makes bigger ones each month once it seems trusted. Can you find accounts that ramp, and tell me if they look risky?"

Leave out failed payments (no money moved). Amounts are in each account's own currency, which is fine here because you'll compare each account only with itself.

Step 1: Anything in the totals?

"First, does anything show up company-wide? For each month, show payments, active accounts and the average payment amount."

Expected output

  • Columns month, payments, accounts, avg_payment (rounded to 2 decimals); sorted by month

Example of the shape (made-up values):

month payments accounts avg_payment
2025-10-01 700 300 80.00

Hints, the later steps and the answer come with Pro.

Step 1 of 3

Write your query here. Ctrl + Enter submits.