题解 | #计算男生人数以及平均GPA#
计算男生人数以及平均GPA
http://www.nowcoder.com/practice/7d9a7b2d6b4241dbb5e5066d7549ca01
select count(*) male_num,avg(gpa) avg_gpa from user_profile where gender='male';
题解要求,男生,平均gpa, 第一个限制为男生,即gender='male',使用where语句进行限制 此时表中所有数据均符合要求,对此表进行count和avg操作即可。