The wealth report needs the total balance across all accounts for each customer. Return first_name, last_name, and total_balance (sum of all account balances). Only include customers with active accounts. Sort by total_balance descending. Limit to top 20.
Schema
🔑idINT
first_nameTEXT
last_nameTEXT
emailTEXT
phoneTEXTNULL
date_of_birthTEXT
cityTEXT
stateTEXT
countryTEXT
created_atTIMESTAMP
postgresql
Run your query to see results
Press Ctrl + Enter to execute