CREATE TABLE ship (ship_id DECIMAL, name TEXT, type TEXT, built_year DECIMAL, class TEXT, flag TEXT)
CREATE TABLE captain (captain_id DECIMAL, name TEXT, ship_id DECIMAL, age TEXT, class TEXT, rank TEXT)

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"