题解 | #浙大不同难度题目的正确率#简单理解
https://www.nowcoder.com/practice/d8a4f7b1ded04948b5435a45f03ead8c
SELECT
difficult_level,
SUM( IF ( result = "right", 1, 0 ))/ COUNT( qpd.device_id ) AS correct_rate
FROM
user_profile up
LEFT JOIN question_practice_detail qpd ON up.device_id = qpd.device_id
inner JOIN question_detail qd ON qd.question_id = qpd.question_id
WHERE
up.university = "浙江大学"
GROUP BY
difficult_level
ORDER BY correct_rate ASC;
difficult_level,
SUM( IF ( result = "right", 1, 0 ))/ COUNT( qpd.device_id ) AS correct_rate
FROM
user_profile up
LEFT JOIN question_practice_detail qpd ON up.device_id = qpd.device_id
inner JOIN question_detail qd ON qd.question_id = qpd.question_id
WHERE
up.university = "浙江大学"
GROUP BY
difficult_level
ORDER BY correct_rate ASC;