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

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"