Your question is Active Customer List by City. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
You are given a customer table from an Eli Lilly commercial analytics environment and asked to write a SQL query that returns the number of active customers in each city. Your result should include the city and the count of active customers, sorted by the customer count in descending order and then by city name ascending. Use only the customers table.
| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer full name |
| city | VARCHAR(100) | Customer city |
| status | VARCHAR(20) | Customer account status |
| signup_date | DATE | Date the customer signed up |