-- Database schema
| captain : Captain_ID [ INT ] primary_key , Name [ TEXT ] , Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID , age [ TEXT ] , Class [ TEXT ] , Rank [ TEXT ] | Ship : Ship_ID [ INT ] primary_key , Name [ TEXT ] , Type [ TEXT ] , Built_Year [ INT ] , Class [ TEXT ] , Flag [ TEXT ] |
-- -- Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.

SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id  =  t2.ship_id WHERE t2.rank  =  'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id  =  t2.ship_id WHERE t2.rank  =  'Lieutenant';