题解 | #统计每个学校的答过题的用户的平均答题数#
统计每个学校的答过题的用户的平均答题数
http://www.nowcoder.com/practice/88aa923a9a674253b861a8fa56bac8e5
SELECT up.university, count(question_id)/count(distinct qpd.device_id) as avg_answer_cnt from user_profile AS up inner join question_practice_detail AS qpd ON qpd.device_id=up.device_id GROUP BY university 每道题最难的点就在于对题目的理解,对于SQL语句的灵活使用,多练习。看到答案时候才恍然大悟,做题时自己却没有思路。