Codington
0 of 8 problems solved • 0%

Exercise prompt

Count Only Failed Runs

WHERE tests each log row before the count is calculated. Run the example to see the failure count for every environment. HAVING can then remove the small groups from that result.

Example

SELECT environment, COUNT(*) AS failure_count FROM deployments WHERE status = 'failed' GROUP BY environment;

Your task

Keep runs with status failed. Group them by environment and return environment and failure_count for environments with at least three such runs.

Opening the database…