General Motors needs to identify vehicle models contributing the most diagnostic trouble codes in a large sensor database. Write a PostgreSQL query that aggregates diagnostic events for January 2024 and returns the top three models.
model, total_events, critical_events, warning_events, affected_vehicles, distinct_dtc_codes, and contributor_rank in that order.2024-01-01 00:00:00 inclusive through 2024-02-01 00:00:00 exclusive.total_events descending, breaking ties by model ascending.contributor_rank ascending.| Column | Type | Description |
|---|---|---|
| vehicle_idPK | INT | Unique vehicle identifier |
| model | VARCHAR(80) | General Motors vehicle model |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique diagnostic event identifier |
| vehicle_id | INT | Vehicle associated with the event |
| dtc_code | VARCHAR(20) | Diagnostic trouble code |
| severity | VARCHAR(20) | Diagnostic event severity |
| event_timestamp | TIMESTAMP | Timestamp when the event was recorded |