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.university='山东大学'&&up.device_id=qpd.device_id&&qpd.question_id=qd.question_id
group by qd.difficult_level;
//还是和之前求平均数一样要注意分母的去重