Back to problems

Write SQL for top drivers and cancellation rates

SQL · PayPal · Medium

Imagine you are working on a rideshare platform that pairs drivers with riders, and the analytics team is focused on airport pickups. All timestamps are UTC. The analysis window is the 28 days ending at the fixed literal '2024-07-31 23:59:59+00' inclusive. In SQL terms, a trip belongs to the window when request_at > TIMESTAMPTZ '2024-07-31 23:59:59+00' - INTERVAL '28 days' and request_at TIMESTAMPTZ '2024-07-31 23:59:59+00' - INTERVAL '28 days' and request_at <= TIMESTAMPTZ…

Checking your access…