题解 | #浙大不同难度题目的正确率#
浙大不同难度题目的正确率
https://www.nowcoder.com/practice/d8a4f7b1ded04948b5435a45f03ead8c
select d.difficult_level, sum(if (c.result = "right", 1, 0)) / count(c.device_id) as correct_rate # avg(if (c.result = "right", 1, 0)) as correct_rate from ( select a.* from question_practice_detail a left join user_profile b on a.device_id = b.device_id where b.university = "浙江大学" ) as c left join question_detail as d on c.question_id = d.question_id group by d.difficult_level order by correct_rate