Skip to main content
All Problems
hard0% acceptance

Percent Rank of Account Balances

The analytics team wants to see what percentile each account's balance falls in within its account type. Use PERCENT_RANK() to compute the percentile. Return account_type, balance, and balance_percentile rounded to 2 decimals. Only include active accounts. Sort by account_type, then balance DESC.

Schema

🔑idINT
🔗customer_idINT
account_typeTEXT
balanceREAL
currencyTEXT
opened_atTEXT
statusTEXT
postgresql

Run your query to see results

Press Ctrl + Enter to execute