Your question is Top Downtime Reasons by Region. 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.
Tesla Operations uses service logs from Tesla Service Centers to identify the largest sources of downtime. Write a PostgreSQL query that returns the top three downtime reasons for the Pacific Northwest region.
region_id.downtime_minutes value and a non-null downtime_reason.| Column | Type | Description |
|---|---|---|
| region_idPK | INTEGER | Unique operating region identifier |
| region_name | VARCHAR(100) | Tesla operating region name |
| Column | Type | Description |
|---|---|---|
| log_idPK | INTEGER | Unique service log identifier |
| region_id | INTEGER | References regions.region_id |
| downtime_reason | VARCHAR(100) | Reason associated with the downtime |
| downtime_minutes | INTEGER | Duration of downtime in minutes |
| service_status | VARCHAR(30) | Status of the service record |