题解 | #统计每个用户的平均刷题数#
统计每个用户的平均刷题数
https://www.nowcoder.com/practice/f4714f7529404679b7f8909c96299ac4
select t1.university, t3.difficult_level, (count(t2.question_id) / count(distinct t1.device_id)) avg_answer_cnt from user_profile t1 left join question_practice_detail t2 on t1.device_id = t2.device_id left join question_detail t3 on t2.question_id = t3.question_id where t1.university = '山东大学' group by t3.difficult_level