Group by ships by flag, and return number of ships that have each flag.
SELECT count(*) ,  flag FROM ship GROUP BY flag
SELECT count(*) ,  flag FROM ship GROUP BY flag
[{'count(*)': 1, 'Flag': 'Malta'}, {'count(*)': 8, 'Flag': 'Panama'}]