Your question is Rank Customers by Support Incidents. Start with the requirements and the two tables 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.
Write a PostgreSQL query that ranks active customers by the number of support incidents. Return each active customer's name, total incident count, count of high-severity incidents, most recent incident date, and rank. Customers with the same total incident count should share the same rank.
| Column | Type | Description |
|---|---|---|
| customer_id | ||
| customer_name | ||
| account_status | ||
| industry |
| Column | Type | Description |
|---|---|---|
| incident_id | ||
| customer_id | ||
| product_name | ||
| severity | ||
| opened_at |