Analyze Taxi Driver and Ride Metrics
Problem statement
You are given one table of taxi drivers and four partitions of ride data. Produce three summary metrics over the complete data set.
- Return the average value of
drivers.ratingwithinsight_typeequal toaverage_driver_rating. - Return the percentage of drivers whose
second_languageis not exactlynowithinsight_typeequal topercentage_drivers_with_second_language. - Combine
rides_1throughrides_4, then return the percentage of rides whosestatusis exactlySuccesswithinsight_typeequal toride_success_rate.
Return a two-column table named by the result contract. Each row corresponds to one task above, in the same order.
Table schema
Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.
drivers
Taxi-driver attributes from drivers.csv.
| Column | Type | Nullable | Description |
|---|---|---|---|
| driver_idPK | Integer | No | Unique driver identifier. |
| age | Integer | No | Driver age. |
| second_language | Text | No | The driver's second language, or the exact value no. |
| rating | Decimal | No | Average driver rating. |
rides_1
First partition of rides_1.csv through rides_4.csv.
| Column | Type | Nullable | Description |
|---|---|---|---|
| ride_idPK | Integer | No | — |
| driver_id | Integer | No | — |
| passenger_id | Integer | No | — |
| date | Text | No | — |
| status | Text | No | — |
Foreign key: driver_id → drivers(driver_id)
rides_2
Second partition of rides_1.csv through rides_4.csv.
| Column | Type | Nullable | Description |
|---|---|---|---|
| ride_idPK | Integer | No | — |
| driver_id | Integer | No | — |
| passenger_id | Integer | No | — |
| date | Text | No | — |
| status | Text | No | — |
Foreign key: driver_id → drivers(driver_id)
rides_3
Third partition of rides_1.csv through rides_4.csv.
| Column | Type | Nullable | Description |
|---|---|---|---|
| ride_idPK | Integer | No | — |
| driver_id | Integer | No | — |
| passenger_id | Integer | No | — |
| date | Text | No | — |
| status | Text | No | — |
Foreign key: driver_id → drivers(driver_id)
rides_4
Fourth partition of rides_1.csv through rides_4.csv.
| Column | Type | Nullable | Description |
|---|---|---|---|
| ride_idPK | Integer | No | — |
| driver_id | Integer | No | — |
| passenger_id | Integer | No | — |
| date | Text | No | — |
| status | Text | No | — |
Foreign key: driver_id → drivers(driver_id)
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| insight_type | Text | No | — |
| value | Decimal | No | — |
Row order: must match exactly. Numeric tolerance: 0.01.
Constraints
- There is at least one driver and at least one ride across the four ride partitions.
driver_idandride_idvalues are unique identifiers in their source files.- Every ride references a driver in
drivers. second_languageuses the exact valuenowhen a driver has no second language.statusis one ofRejected by the driver,Cancelled by the passenger, orSuccess.- Percentages use the 0-to-100 scale. Numeric results are accepted within 0.01 of the expected value.
Source note: The screenshots are shown in source order. FastPrep cropped unrelated source-page chrome and added its watermark without covering task content.