题解 | #每个学校的平均年龄和平均绩点及整体情况#

每个学校的平均年龄和平均绩点及整体情况

https://www.nowcoder.com/practice/d686ac1d09d94441be91475843797d2d

#不解释
select "总体" as university ,sum(age)/count(*) avg_age,sum(gpa)/count(*) avg_gpa from user_profile 
union all
select university,sum(age)/count(*) avg_age,sum(gpa)/count(*) avg_gpa from user_profile group by university

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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