How many people are under 40 for each gender?
select count(*), gender from person where age < 40 group by gender