1.查询年龄在14到18之间的男性的姓名和性别
select Name,Age from student where age between 14 and 18 and sex='男'
2.查询每个部门的女性的平均年龄,降序排序
select Dept,avg(age) age from student where sex='女' group by Dept Order By age desc
未经验证,有问题欢迎评论区指正~