Back to problems

Measure Daily Late-Order Rates by Delivery Zone

SQL · DoorDash · Medium

Given a PostgreSQL table orders, write one query that reports one row for every UTC date and delivery zone where at least one eligible order exists. The table contains these columns: An order is eligible only when status = 'completed' and delivered_at IS NOT NULL. Do not include rows whose status is 'cancelled' or 'failed', and do not include completed rows where delivered_at is null. Group the eligible rows by the UTC calendar date of created_at and by delivery_zone. If a…

Checking your access…