select a.device_id, a.university, coalesce(count(b.question_id),0) as question_cnt, coalesce(count(if(b.result = 'right', b.question_id, null)),0) as right_question_cnt from user_profile a left join question_practice_detail b on a.device_id = b.device_id where a.university = '复旦大学' a...