Calculate the percentage of total bank balance held in each account type. Return account_type, type_total (sum of balances for that type), and pct_of_total (rounded to 2 decimals). Use a subquery to get the overall total. Order by 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