select exam_id, sum(if(submit_time is null,1,0)) incomplete_cnt, round(sum(if(submit_time is null,1,0)) / count(start_time),3) incomplete_rate
from exam_record
group by exam_id
having incomplete_cnt>0;
from exam_record
group by exam_id
having incomplete_cnt>0;