GROUP BY with strftime
Inbound receipt count by day of week. Show day_of_week (0=Sunday) and receipt_count.
| 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.
Day-of-week is buried in a timestamp — there is a Postgres function that extracts it as 0–6.
EXTRACT(DOW FROM ts) returns 0=Sunday through 6=Saturday — group on that expression.
Project two columns, day_of_week and receipt_count, and order chronologically.