SELECT gender, COUNT(*) FROM people GROUP BY gender;
SELECT country, COUNT(*) AS customers
FROM Customers
GROUP BY country;
# To count the number of teachers in each department, including
# rows where COUNT(t.name) == 0
SELECT d.name,COUNT(t.name) FROM teacher t
RIGHT JOIN dept d ON (t.dept=d.id) GROUP BY d.name;