select uid, 
      round(sum(if(score is not null, score, 0))/count(start_time), 0) as avg_score,
round(sum(if(score is not null, 
             timestampdiff(minute, start_time, submit_time), 
              duration))/count(start_time), 1) as avg_time_took
from user_info t1 join exam_record t2 using(uid)
                  join examination_info t3 using(exam_id)
    where level = 0 and difficulty = 'hard'
group by uid
我怎么老是改不了写冗长代码的习惯呢。。。