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 ranks of captains are in the Cutter class?
assistant
SELECT DISTINCT rank FROM captain WHERE CLASS = 'Cutter';
human
How about Armed schooner?
assistant
SELECT rank FROM captain WHERE CLASS = 'Armed schooner';
human
Intersect those.
assistant
SELECT rank FROM captain WHERE CLASS = "Cutter" INTERSECT SELECT rank FROM captain WHERE CLASS = "Armed schooner" ;