human
Schema:
mission (Mission_ID, Ship_ID, Code, Launched_Year, Location, Speed_knots, Fate)
ship (Ship_ID, Name, Type, Nationality, Tonnage)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.
assistant
SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000;
human
Show the types of ships with tonnage between 3000 and 5000.
assistant
SELECT distinct TYPE FROM ship WHERE Tonnage > 3000 AND Tonnage < 5000 ;