Your question is Order Pickup Time SQL. Start with the requirements and the three 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.
DoorDash operations teams monitor how quickly confirmed orders are picked up by Dashers. Write a PostgreSQL query that calculates this interval by restaurant.
| Column | Type | Description |
|---|---|---|
| restaurant_idPK | INT | Unique restaurant identifier |
| restaurant_name | VARCHAR(100) | Restaurant display name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique DoorDash order identifier |
| restaurant_id | INT | Restaurant associated with the order |
| order_status | VARCHAR(20) | Current order lifecycle status |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Order associated with this log record |
| restaurant_confirmed_at | TIMESTAMP | Timestamp when the restaurant confirmed the order |
| dasher_picked_up_at | TIMESTAMP | Timestamp when the Dasher picked up the order |