Skip to main content
All Problems
medium0% acceptance

Branch with the Most Customer Accounts

Management wants to know which branch city has the most customer accounts. Count the number of accounts per branch city by joining customers to accounts and matching customer city to branch city. Return city, branch name, and account_count. Sort by account_count descending. Limit to 10.

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