Ride-Sharing Trip Analytics
โจ Master SQL One Problem at a Time โจ
Get all CSV files to practice this challenge:
๐ฅ Download Day 17 Data5 tables: trips, drivers, riders, surge_pricing, cancellations
Build a comprehensive ride-sharing analytics system with surge pricing, cancellation tracking, and driver performance metrics.
| trip_id | rider_id | driver_id | pickup_time | dropoff_time | distance_km | fare_amount | status |
|---|---|---|---|---|---|---|---|
| T001 | R101 | D201 | 2024-01-15 08:30:00 | 2024-01-15 09:15:00 | 12.5 | 250.00 | completed |
| t002 | r102 | D202 | 15/01/2024 10:00 | NULL | NULL | NULL | CANCELLED |
| T003 | R103 | d203 | 2024-01-15 14:30:00 | 2024-01-15 15:10:00 | 8.3 | 175.50 | Completed |
| T004 | r104 | D204 | 16/01/2024 07:45 | 16/01/2024 08:20 | 15.2 | NULL | completed |
| t005 | R105 | D201 | 2024-01-16 18:00:00 | 2024-01-16 18:45:00 | 10.8 | 320.00 | COMPLETED |
...45 more rows in the download!
| driver_id | driver_name | join_date | vehicle_type | rating | total_trips |
|---|---|---|---|---|---|
| D201 | amit sharma | 2023-05-10 | sedan | 4.8 | 523 |
| d202 | PRIYA KUMAR | 15/06/2023 | SUV | NULL | 412 |
| D203 | rajesh patel | 2023-07-22 | SEDAN | 4.5 | NULL |
| D204 | NEHA SINGH | 10-08-2023 | suv | 4.9 | 678 |
| d205 | VIKRAM RAO | 2023-09-15 | Sedan | 4.7 | 345 |
| rider_id | rider_name | signup_date | city | total_trips |
|---|---|---|---|---|
| R101 | john doe | 2024-01-01 | mumbai | 15 |
| r102 | SARAH SMITH | 05/01/2024 | Delhi | NULL |
| R103 | MIKE WILSON | 2024-01-08 | bangalore | 22 |
| R104 | anna garcia | 10-01-2024 | MUMBAI | 8 |
| r105 | Bob Martin | 2024-01-12 | Delhi | 12 |
| surge_id | trip_id | surge_multiplier | surge_start | surge_end |
|---|---|---|---|---|
| S001 | T005 | 2.5 | 2024-01-16 17:30:00 | 2024-01-16 19:30:00 |
| S002 | t012 | 1.8 | 15/01/2024 08:00 | 15/01/2024 10:00 |
| S003 | T018 | NULL | 2024-01-17 18:00:00 | 2024-01-17 20:00:00 |
| S004 | T023 | 2.0 | 2024-01-18 08:30:00 | 2024-01-18 10:00:00 |
| S005 | t029 | 1.5 | 19/01/2024 17:00 | 19/01/2024 19:00 |
| cancel_id | trip_id | cancelled_by | cancel_reason | cancel_time |
|---|---|---|---|---|
| C001 | T002 | rider | driver too far | 2024-01-15 10:05:00 |
| C002 | t008 | DRIVER | NULL | 16/01/2024 12:30 |
| C003 | T015 | rider | CHANGE OF PLANS | 2024-01-17 08:15:00 |
| C004 | t022 | Driver | traffic jam | 18-01-2024 14:45 |
| C005 | T031 | RIDER | long wait time | 2024-01-20 11:30:00 |
Build ride-sharing analytics with surge analysis, cancellation tracking, and driver performance metrics.
๐ก Key SQL Concepts: Window Functions (RANK, PARTITION BY), TIMESTAMPDIFF, Complex JOINs, CTEs, CASE WHEN!
Download the full challenge PDF with complete solution, explanations, and step-by-step hints!
Follow for complete solutions and all 100 challenges:
Complete solutions posted on LinkedIn โข All data on GitHub
Master ride-sharing analytics
Track surge pricing patterns
Analyze driver performance
Day 18 coming tomorrow!
Follow the 100 Days SQL Challenge
Master SQL one problem at a time!
Rahul Kanche โ exploring data, decoding clarity!