题解 | #统计复旦用户8月练题情况#
统计复旦用户8月练题情况
https://www.nowcoder.com/practice/53235096538a456b9220fce120c062b3
解法:
#MySQL##数据分析#
select u.device_id,u.university,count(q.question_id) question_cnt,count(if(q.result='right',q.question_id,null)) right_question_cnt from user_profile u left join question_practice_detail q on u.device_id=q.device_id and month(q.date)=8 where u.university='复旦大学' group by u.device_id,u.university;
#MySQL##数据分析#