Food Delivery Order Lifecycle Analysis
โจ Master SQL One Problem at a Time โจ
Get all CSV files to practice this challenge:
๐ฅ Download Day 18 Data5 tables: orders, riders, restaurants, customers, order_status_log
Build analytics for order tracking, delivery time optimization, and rider performance in food delivery platforms.
| order_id | customer_id | restaurant_id | rider_id | order_time | delivery_time | order_value | status |
|---|---|---|---|---|---|---|---|
| ORD001 | C101 | R201 | RID301 | 2024-02-10 12:30:00 | 2024-02-10 13:15:00 | 450.00 | delivered |
| ord002 | c102 | R202 | NULL | 10/02/2024 13:00 | NULL | NULL | CANCELLED |
| ORD003 | C103 | r203 | RID302 | 2024-02-10 14:15:00 | 2024-02-10 15:00:00 | 680.50 | Delivered |
| ORD004 | c104 | R204 | rid303 | 11/02/2024 12:00 | 11/02/2024 12:50 | 320.00 | delivered |
| ord005 | C105 | R201 | RID304 | 2024-02-11 18:30:00 | 2024-02-11 19:20:00 | 550.00 | DELIVERED |
...45 more rows in the download!
| rider_id | rider_name | phone | join_date | rating | total_deliveries |
|---|---|---|---|---|---|
| RID301 | amit kumar | 9876543210 | 2023-08-15 | 4.7 | 856 |
| rid302 | PRIYA SINGH | 9876543211 | 15/09/2023 | NULL | 624 |
| RID303 | rajesh patel | 9876543212 | 2023-10-05 | 4.5 | NULL |
| RID304 | NEHA SHARMA | 9876543213 | 10-11-2023 | 4.9 | 789 |
| rid305 | VIKRAM RAO | 9876543214 | 2023-12-20 | 4.6 | 512 |
| restaurant_id | restaurant_name | cuisine_type | city | rating | avg_prep_time |
|---|---|---|---|---|---|
| R201 | pizza palace | Italian | mumbai | 4.3 | 25 |
| r202 | BURGER KING | Fast Food | Delhi | NULL | 15 |
| R203 | SPICE GARDEN | Indian | bangalore | 4.7 | 30 |
| R204 | sushi hub | Japanese | MUMBAI | 4.5 | NULL |
| r205 | Taco Bell | Mexican | Delhi | 4.2 | 20 |
| customer_id | customer_name | signup_date | city | total_orders |
|---|---|---|---|---|
| C101 | john doe | 2024-01-05 | mumbai | 28 |
| c102 | SARAH KHAN | 10/01/2024 | Delhi | NULL |
| C103 | MIKE WILSON | 2024-01-12 | bangalore | 35 |
| C104 | anna garcia | 15-01-2024 | MUMBAI | 12 |
| c105 | Bob Martin | 2024-01-18 | Delhi | 22 |
| log_id | order_id | status | timestamp | notes |
|---|---|---|---|---|
| L001 | ORD001 | placed | 2024-02-10 12:30:00 | Order received |
| L002 | ord001 | CONFIRMED | 10/02/2024 12:35 | restaurant confirmed |
| L003 | ORD001 | preparing | 2024-02-10 12:40:00 | NULL |
| L004 | ORD001 | OUT_FOR_DELIVERY | 2024-02-10 13:00:00 | Rider assigned |
| L005 | ord001 | delivered | 2024-02-10 13:15:00 | delivered successfully |
Build food delivery lifecycle analytics with order tracking, delivery time analysis, and rider performance metrics.
๐ก Key SQL Concepts: TIMESTAMPDIFF, RANK, PARTITION BY, Window Functions, CTEs, Complex JOINs!
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 food delivery analytics
Track order lifecycles
Optimize delivery times
Day 19 coming tomorrow!
Follow the 100 Days SQL Challenge
Master SQL one problem at a time!
Rahul Kanche โ exploring data, decoding clarity!