注意
1、inner join 保留两个表之前能成功匹配的部分,匹配不到不取
2、on 后面写入两个表可以连接的唯一值
3、where 在表格嵌套后做条件筛选

select difficult_level,
avg(if (qpd.result= "right",1,0)) correct_rate
from  question_practice_detail qpd

inner join user_profile up
on qpd.device_id=up.device_id

inner  join question_detail qd
on qpd.question_id=qd.question_id

where up.university="浙江大学"
group by difficult_level
order by correct_rate