SQL · DoorDash · Medium
Given four tables — users, orders, couriers, and calendar_months — write PostgreSQL-flavoured SQL for each of the six analytics requests below. Treat the reference date "today" as 2025-09-01. Every query should be efficient enough for a large warehouse (avoid quadratic self-joins; prefer conditional aggregation and window functions), and each query may be accompanied by short SQL comments that name the window functions or join strategies used. Table shapes: users(user_id…
Checking your access…