Count the number of captains younger than 50 of each rank.
select count(*), rank from captain where age < 50 group by rank