What are the different ship flags, and how many ships have each?
select count(*), flag from ship group by flag