题解 | #试卷发布当天作答人数和平均分#

试卷发布当天作答人数和平均分

https://www.nowcoder.com/practice/5b58e89556dc4153a79d8cf8c08ba499

select
  t1.exam_id,
  count(distinct t3.uid) as uv,
  round(sum(t1.score) / count(t1.exam_id), 1) as avg_score
from
  exam_record t1
  left join examination_info t2 on t1.exam_id = t2.exam_id
  left join user_info t3 on t1.uid = t3.uid
where
  t1.submit_time is not null
  and t2.tag = 'SQL'
  and t3.level > 5
group by
  t1.exam_id
order by
  uv desc,
  avg_score asc

全部评论

相关推荐

06-23 18:25
沈阳大学 Java
HR已读不回,是我说话方式不对吗?
大白之主:你是串子吗? hr: 我们不招人了,把岗位挂着boss只是因为我闲得慌
点赞 评论 收藏
分享
06-17 21:57
门头沟学院 Java
白友:噗嗤,我发现有些人事就爱发这些,明明已读不回就行了,就是要恶心人
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务