select emp_id,emp_level,tag as exam_tag from
(select t4.exam_id as exam_id,avg_time,avg_record,emp_id,tag,emp_level,time_count,score from
(select exam_id,sum(timestampdiff(second,start_time,submit_time))/count(1)/60 as avg_time,sum(score)/count(1) as avg_record from exam_record 
group by exam_id) as t4
join 
(select emp_id,tag,emp_level,time_count,score,exam_id from
(
select emp_id,t1.exam_id as exam_id,tag,emp_name,emp_level,time_count,score from examination_info
join
(
select emp_info.emp_id as emp_id, emp_name, emp_level,exam_id,time_count,score from emp_info
join 
(
select emp_id,exam_id,timestampdiff(minute,start_time,submit_time) as time_count,score from exam_record
) as exam
on emp_info.emp_id = exam.emp_id
where emp_level < 7) as t1
on examination_info.exam_id = t1.exam_id) as t2) as t3
on t4.exam_id = t3.exam_id
where time_count < avg_time and score > avg_record) as t4
order by emp_id asc,exam_id asc