query for gender counts