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

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

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

select qd.difficult_level, (sum(case when a.result='right' then 1 else 0 end))/(count(a.result)) as correct_rate
from
question_detail qd
inner join 
(select* from 
question_practice_detail q
where q.device_id in 
(select device_id from user_profile where university='浙江大学')) a
on qd.question_id=a.question_id
group by qd.difficult_level
order by correct_rate

#先從user_profile表篩選大學為浙江大學的device_id
#再篩選question_practice_detail表中為浙江大學學生device答題數數據成為a表
#再根據question_id inner join question_detail表和a表
#利用sum(case when......)計算答題正確的次數再除以答題結果的次數為正確率
#利用difficult level計算每個難易度的正確率

全部评论

相关推荐

07-29 13:49
深圳大学 运营
字节我爱你
JamesGosli...:秋招还是实习啊
点赞 评论 收藏
分享
Lorn的意义:你这种岗位在中国现在要么牛马天天加班,要么关系户进去好吃好喝,8年时间,真的天翻地覆了,对于资本来说你就说一头体力更好的牛马,哎,退伍没有包分配你真的亏了。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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