Skip to main content
All Problems
hard0% acceptance

Account Balance Quartiles

The analytics team wants to segment accounts into four balance quartiles. Use NTILE(4) to assign each account to a quartile based on balance. Return id, account_type, balance, and quartile. Only include active accounts. Order by balance descending.

Schema

🔑idINT
🔗customer_idINT
account_typeTEXT
balanceREAL
currencyTEXT
opened_atTEXT
statusTEXT
postgresql

Run your query to see results

Press Ctrl + Enter to execute