题解 | #统计每个学校的答过题的用户的平均答题数#

统计每个学校的答过题的用户的平均答题数

https://www.nowcoder.com/practice/88aa923a9a674253b861a8fa56bac8e5

/* select university,round(count(q.question_id)/count(distinct(q.device_id)),4) as avg_answer_cnt 
from user_profile,question_practice_detail q 
where user_profile.device_id=q.device_id 
group by university 
order by university asc
*/

select university, round(avg(num),4) from
(select device_id,count(1) as num from question_practice_detail 
group by device_id ) q left join user_profile on user_profile.device_id =q.device_id
group by university order by university

全部评论

相关推荐

榕城小榕树:1200单休,我去干点啥别的不好
点赞 评论 收藏
分享
06-02 15:17
门头沟学院 Java
心爱的idea:怎么会呢 应该是打招呼有问题 问就说实习6个月全国可飞随时到岗
点赞 评论 收藏
分享
06-20 17:42
东华大学 Java
凉风落木楚山秋:要是在2015,你这简历还可以月入十万,可惜现在是2025,已经跟不上版本了
我的简历长这样
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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