1SELECT 2 COUNT(*) AS total, 3 AVG(age) AS avg_age 4FROM 5 users 6GROUP BY department 7HAVING COUNT(*) > 5