题解 | 浙大不同难度题目的正确率

浙大不同难度题目的正确率

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

with
    base as (
        select
            qpd.device_id as device_id,
            qpd.question_id as question_id,
            result,
            difficult_level
        from
            question_practice_detail qpd
            left join user_profile u on u.device_id = qpd.device_id
            left join question_detail qd on qpd.question_id = qd.question_id
        where
            university = '浙江大学'
    ),
    tmp as (
        select
            difficult_level,
            count(question_id) as total_questions,
            sum(
                case
                    when result = 'right' then 1
                    else 0
                end
            ) as right_cn
        from
            base
        group by
            difficult_level
    )
select difficult_level,round(right_cn/total_questions,4) correct_rate from tmp order by round(right_cn/total_questions,4) asc

全部评论

相关推荐

04-28 15:42
郑州大学 C++
找工作勤劳小蜜蜂:网易这几个月在大面积裁员,外包岗全退,今年网易收缩严重,建议慎重考虑网易
点赞 评论 收藏
分享
鱼专:别投了,我看到有人点了第二个链接投递,还没退出界面,不合适的邮件就发过来了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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