CREATE TABLE ship (ship_id DECIMAL, name TEXT, type TEXT, built_year DECIMAL, class TEXT, flag TEXT)
CREATE TABLE captain (captain_id DECIMAL, name TEXT, ship_id DECIMAL, age TEXT, class TEXT, rank 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'
SELECT "t1"."name" FROM "ship" AS "t1" JOIN "captain" AS "t2" ON "t1"."ship_id" = "t2"."ship_id" AND "t2"."rank" = 'Midshipman' INTERSECT SELECT "t1"."name" FROM "ship" AS "t1" JOIN "captain" AS "t2" ON "t1"."ship_id" = "t2"."ship_id" AND "t2"."rank" = 'Lieutenant'