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

select
    up.university,
    round(
        count(qpd.question_id) / count(distinct up.device_id),
        4
    ) as avg_answer_cnt
from
    user_profile as up
    inner join question_practice_detail as qpd on up.device_id = qpd.device_id
group by
    up.university
order by
    up.university asc

全部评论

相关推荐

码农索隆:竞争压力小,就你一个不用卷
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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