Codington
0 of 8 problems solved • 0%

Exercise prompt

Write a Timing Summary for Worker

The worker service has ID 20. Its owner needs the number of attempts as well as a timing summary. Each aggregate in a SELECT reads the same set of filtered rows.

Your task

For service_id = 20, return one row with five columns in this order: number of runs (run_count), total recorded seconds (total_seconds), average (avg_seconds), shortest (min_seconds) and longest (max_seconds). Include runs without a measurement in the run count.

Opening the database…