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

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

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

# 现在运营想要了解浙江大学的用户在不同难度题目下答题的正确率情况,请取出相应数据,并按照准确率升序输出。
with t1 as
(select
    qpl.device_id,
    qpl.question_id,
    university,
    result,
    difficult_level
from question_practice_detail qpl
left join question_detail using(question_id)
left join user_profile using(device_id))

select 
    difficult_level,
    avg(if(result='right', 1, 0)) as correct_rate
from t1
where university = '浙江大学'
group by difficult_level
order by correct_rate

全部评论

相关推荐

02-28 20:57
已编辑
南京大学 算法工程师
点赞 评论 收藏
分享
点赞 评论 收藏
分享
zhiyog:哈哈哈,其实是津巴布韦币
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务