正确率=正确数量/总答题数,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;