题解 | #统计每个用户的平均刷题数#
统计每个用户的平均刷题数
http://www.nowcoder.com/practice/f4714f7529404679b7f8909c96299ac4
SELECT t1.university, t3.difficult_level, COUNT(t2.question_id) / COUNT(DISTINCT(t2.device_id)) as avg_answer_cnt from user_profile as t1, question_practice_detail as t2, question_detail as t3 WHERE t1.university = '山东大学' and t1.device_id = t2.device_id and t2.question_id = t3.question_id GROUP BY t3.difficult_level;