What are the ships that are steered by a captain with Midshipman rank?
select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id where t2.rank = 'Midshipman'
What are the ships that are steered by 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 = 'Lieutenant'
Oh sorry, yes ships that are included in both lists
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'