select up.university,qd.difficult_level,count(qpd.device_id)/count(distinct up.device_id) from user_profile up,question_practice_detail qpd,question_detail qd
where up.device_id=qpd.device_id&&qpd.question_id=qd.question_id
group by up.university,qd.difficult_level;//注意本题求平均数的时候,要对分母去重,因为同一个人只能算一次,但是他却可以答不止一道题目