How many ships are there?
select count ( * ) from ship
Out of them which ship names have more than one captain?
select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id group by t2.ship_id having count ( * ) > 1
How about ship names with only one captain?
select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id group by t2.ship_id having count ( * ) = 1