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

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

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

SELECT user_profile.university,
round(count(question_practice_detail.question_id)/count(DISTINCT question_practice_detail.device_id),4) as avg_answer_cnt
from user_profile
inner join  question_practice_detail
on user_profile.device_id =  question_practice_detail.device_id
group by university
order by university;

两个表按照device_id 取交集

全部评论

相关推荐

12-19 15:04
门头沟学院 Java
小肥罗:hr爱上你了,你负责吗哈哈
点赞 评论 收藏
分享
回家当保安:加油, 我当时也想拒字节面试,是被HR鼓励着我面试。然后走了2周流程 ,一共3+1 面,最后惊喜的发了offer。佬可以试试
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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