The on-call team wants one line per service that needs investigation. A deployment can fail even if its duration was never recorded. Decide which rows contribute to the failure count and which groups belong on the handover list.
Using WHERE, GROUP BY and HAVING, list registered services with at least three deployments whose status is failed across all environments combined. Return the service name as service and its count as failure_count. Sort by most failures first, then alphabetically by service name.