Find customers who hold more than one distinct type of account (e.g., both checking and savings). Return customer_id, the customer's first_name, last_name, and the count of distinct account types (type_count). Only include customers with type_count > 1. Order by type_count descending, then last_name ascending.
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