Your question is Total Driver Time Per Day. Start with the requirements and the two 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.
Uber's driver activity reporting needs daily totals even when an Uber trip starts on one calendar day and ends on another. Trip timestamps are stored in UTC. Write a PostgreSQL query that calculates driver time for each day from 2024-01-01 through 2024-01-04, inclusive.
| Column | Type | Description |
|---|---|---|
| driver_idPK | INTEGER | Unique Uber driver identifier |
| driver_name | VARCHAR(100) | Driver display name |
| Column | Type | Description |
|---|---|---|
| trip_idPK | INTEGER | Unique trip identifier |
| driver_id | INTEGER | Assigned Uber driver identifier |
| started_at | TIMESTAMP | Trip start timestamp in UTC |
| ended_at | TIMESTAMP | Trip end timestamp in UTC |