题解 | #统计每个学校各难度的用户平均刷题数#
统计每个学校各难度的用户平均刷题数
https://www.nowcoder.com/practice/5400df085a034f88b2e17941ab338ee8
SELECT user_profile.university, question_detail.difficult_level, ROUND( COUNT(question_practice_detail.question_id) / COUNT(DISTINCT question_practice_detail.device_id), 4 ) as avg_answer_cnt FROM user_profile, question_practice_detail, question_detail WHERE user_profile.device_id = question_practice_detail.device_id AND question_practice_detail.question_id = question_detail.question_id GROUP BY university, difficult_level ;
难题记录