Write a query to identify top-performing regions based on specific KPI thresholds for Bolt.
Use the supplied region, KPI measurement, and threshold data. A region qualifies only when its average value meets or exceeds every defined KPI threshold.
region_name, completion_rate, acceptance_rate, rides_completed, and kpis_met.kpis_met descending, then region_name ascending.| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique region identifier |
| region_name | VARCHAR(100) | Bolt operating region name |
| country_code | VARCHAR(2) | Two-letter country code |
| Column | Type | Description |
|---|---|---|
| measurement_idPK | INT | Unique KPI measurement identifier |
| region_id | INT | Region associated with the measurement |
| kpi_name | VARCHAR(50) | KPI being measured |
| kpi_value | NUMERIC(12,4) | Measured KPI value |
| Column | Type | Description |
|---|---|---|
| kpi_namePK | VARCHAR(50) | KPI for which a threshold is defined |
| minimum_value | NUMERIC(12,4) | Minimum acceptable KPI value |