SELECT university, difficult_level, count(*)/count(distinct u.device_id) avg_answer_cnt
    FROM user_profile u
    LEFT JOIN question_practice_detail pd 
    ON u.device_id = pd.device_id
    LEFT JOIN question_detail qd
    ON pd.question_id = qd.question_id
    WHERE u.university = '山东大学'
GROUP BY difficult_level
ORDER BY difficult_level