I have two tables in a MySQL database. The first one has a list of department names.
departments abbreviation | name -------------|-------------
SELECT d.abbreviation, COUNT(*) num FROM departments d INNER JOIN courses c ON c.section LIKE CONCAT(d.abbreviation, "%") GROUP BY d.abbreviation
Sql Fiddle