Chapter 5 · JOINs
75. Customers Who Live in a Branch City
Hard40 XPFinance
The compliance team wants to find customers who live in the same city as a bank branch. Join customers to branches on the city column. Return customer_id, first_name, last_name, city, and the branch name. Sort by city, then last_name.
Tables
- PKidINT
- first_nameTEXT
- last_nameTEXT
- emailTEXT
- phoneTEXT
- date_of_birthTEXT
- cityTEXT
- stateTEXT
- countryTEXT
- created_atTIMESTAMP
- PKidINT
- nameTEXT
- cityTEXT
- stateTEXT
- manager_nameTEXT
- opened_atTEXT
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.