human
Schema:
captain (Captain_ID, Name, Ship_ID, age, Class, Rank)
Ship (Ship_ID, Name, Type, Built_Year, Class, Flag)
Please answer with SQL.
assistant
Sure, I understand.
human
Which flag is least widely used among all ships?
assistant
SELECT flag FROM ship GROUP BY flag ORDER BY COUNT( * ) LIMIT 1;
human
How many flags in this table?
assistant
SELECT COUNT( flag ) FROM ship;
human
How many built year same in this table? | did you mean 'How many built year saved this table'? | Yes.
assistant
SELECT COUNT( distinct Built_Year ) FROM ship;
human
How many names in this table?
assistant
SELECT COUNT( distinct Name ) FROM ship ;