Group by ships by flag, and return number of ships that have each flag.
CREATE TABLE ship (flag VARCHAR)
SELECT COUNT(*), flag FROM ship GROUP BY flag
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE ship (flag VARCHAR) Question: Group by ships by flag, and return number of ships that have each flag. [/INST] SELECT COUNT(*), flag FROM ship GROUP BY flag </s>