AVG of timestamp diff
Average dock-to-stock time in minutes — dock_arrival_ts to putaway_complete_ts. Single number.
| Column | Type | Key |
|---|---|---|
| receipt_id | INT | PK |
| supplier_id | INT | |
| dock_door | INT | |
| dock_arrival_ts | TEXT | |
| unload_complete_ts | TEXT | |
| count_complete_ts | TEXT | |
| putaway_complete_ts | TEXT | |
| expected_units | INT | |
| actual_units | INT | |
| worker_id | INT | FK → dim_workers |
Each hint you reveal reduces the XP you can earn. Try the query first.
Dock-to-stock is the gap between dock_arrival_ts and putaway_complete_ts on each receipt.
Subtracting two timestamps in Postgres returns an interval — pull the seconds with EXTRACT(EPOCH FROM …) and divide by 60 for minutes.
Wrap the per-row minutes expression in AVG() so a single row comes back across all receipts.