GROUP BY gives each service its own count. Try the example with COUNT(*). Look at search: LEFT JOIN keeps a row for it even though the deployment ID is NULL. Which column can you count to measure actual runs?
SELECT s.name AS service, COUNT(*) AS joined_rows
FROM services AS s
LEFT JOIN deployments AS d ON s.id = d.service_id
GROUP BY s.name;Start from services and use LEFT JOIN to report each service name as service and its number of deployments as run_count. Show one row per service and zero for a service that has never run.