题解 17 | #计算男生人数以及平均GPA#

【分类】:聚合函数、count、avg

分析思路

select 查询结果 [count(性别) as male_num,avg(gpa) as avg_gpa]
from 从哪张表中查找数据 [user_profile]
where 查询条件 [男生]

求解代码

select 
    count(gender) as male_num,
    avg(gpa) as avg_gpa
from user_profile
where gender = 'male'
全部评论

相关推荐

每晚夜里独自颤抖:要求太多的没必要理
点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务