select a.device_id,university, sum( case when question_id is not null then 1 else 0 end ) as question_cnt , sum( case when result = 'right' then 1 else 0 end ) as right_question_cnt from user_profile a left join question_practice_detail b on a.de...