📖 Story
Urban Company · Home Services Ops Analytics
Urban Company's operations team wants to publish an internal "how long does a job actually take on-site" benchmark per service, so the scheduling engine can block realistic time slots for its partners. The timestamps live as TEXT ('2026-03-03 10:00'), and a junior analyst's first attempt simply subtracted completed_at minus scheduled_at — which came back as a neat column of zeros for every single job. On top of that, the table also holds cancelled bookings and jobs that are still in progress, whose completed_at is genuinely NULL because the job hasn't finished yet, and those must not be counted as jobs in the benchmark.