Skip to main content
All Problems
hard0% acceptance

Each Account as Percentage of Customer Total

For each account, show what percentage it represents of its customer's total balance. Return customer_id, account_type, balance, customer_total (sum of all the customer's account balances), and pct_of_total rounded to 1 decimal. Only include active accounts. Sort by customer_id, then pct_of_total descending.

Schema

🔑idINT
🔗customer_idINT
account_typeTEXT
balanceREAL
currencyTEXT
opened_atTEXT
statusTEXT
postgresql

Run your query to see results

Press Ctrl + Enter to execute