类别 SQL
发布当天
用户为五级以上

select t.exam_id
,count(distinct t.uid) as uv
,round(avg(t.score),1) as avg_score
from exam_record t inner join examination_info t1 on t.exam_id =t1.exam_id and date(t.submit_time) = date(t1.release_time)
inner join user_info t2 using(uid)
where t2.level>5 and t1.tag = "SQL"
group by exam_id
order by uv desc,avg_score

使用表连接完成