Your question is Identify Top Partner Error Modes. 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.
You are given partner error logs and a lookup of error codes. Write a PostgreSQL query that identifies the top failure modes by partner, showing each partner’s error category, the number of occurrences, and the share of that partner’s total errors. Focus on the most frequent failure modes and exclude partners with no logged errors.
| Column | Type | Description |
|---|---|---|
| error_idPK | INT | Primary key for each error event |
| partner_id | INT | Partner identifier |
| error_code | VARCHAR(50) | Error code reported by the partner |
| occurred_at | TIMESTAMP | When the error occurred |
| Column | Type | Description |
|---|---|---|
| error_codePK | VARCHAR(50) | Error code key |
| error_category | VARCHAR(100) | Normalized failure mode name |
| severity | VARCHAR(20) | Severity label for the code |