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

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

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

正确率=正确数量/总答题数,case when 进行条件判断是否正确
select c.difficult_level, sum( case b.result when 'right' then 1 else 0 end)/count(a.device_id) as correct_rate
from user_profile as a
inner join
question_practice_detail as b
on a.device_id=b.device_id
inner join
question_detail as c
on b.question_id=c.question_id
where university='浙江大学'
group by c.difficult_level
order by  correct_rate;

全部评论

相关推荐

程序员牛肉:你这简历有啥值得拷打的?在牛客你这种简历一抓一大把,也就是个人信息不一样而已。 关键要去找亮点,亮点啊,整个简历都跟流水线生产出来的一样。
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
12-17 17:40
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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