SELECT university,COUNT(qt.question_id)/COUNT(distinct(qt.device_id)) avg_answer_cnt
FROM question_practice_detail qt LEFT JOIN user_profile ut
ON qt.device_id=ut.device_id
GROUP BY university
SELECT university,COUNT(qt.question_id)/COUNT(distinct(qt.device_id)) avg_answer_cnt
FROM question_practice_detail qt LEFT JOIN user_profile ut
ON qt.device_id=ut.device_id
GROUP BY university