select ui.uid , count(distinct er.exam_id) exam_cnt,count(distinct pr.submit_time) question_cnt from user_info ui join exam_record er using(uid) join examination_info ei using(exam_id) left join practice_record pr using(uid) where ui.uid in ( select ui.uid uid from user_info ui join exam_record er ...