Client spend in the last 30 days
An MTS product analyst pulls a weekly leaderboard of top wallets by spend in the last month — feeds trigger campaigns and upsell offers. Clients are identified by UUIDs from billing; transaction amounts arrive in rubles with kopecks.
Compute total spend per client over the last 30 days relative to CURRENT_DATE (today inclusive). The biggest wallets come on top. Skip clients with no transactions in that window.
Treat the current moment as 2026-05-05 12:00:00 UTC — every relative-time expression in the seed and the reference solution is anchored to that point.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| client_id | spend_30d |
|---|---|
| 55555555-5555-5555-5555-000000000104 | 9000.00 |
| 11111111-1111-1111-1111-000000000100 | 2300.50 |
| 22222222-2222-2222-2222-000000000101 | 2200.00 |
MTS
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inFocus radio
Paused · SomaFM · Fluid