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

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

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

with tiaojian as (
select 
uid
from user_info
where
level>5
),tiaojian1 as (
select 
exam_id,
release_time
from examination_info
where
tag="SQL"
)


select 
t1.exam_id,
count(distinct t.uid) as uv,
round(avg(score),1) as avg_score
from exam_record ed inner join tiaojian t on 
ed.uid=t.uid inner join tiaojian1 t1 on t1.exam_id=ed.exam_id
where
date(ed.submit_time)=date(release_time)
group by exam_id
order by uv desc,avg_score asc

全部评论

相关推荐

菜菜狗🐶:双非之光
找工作,你会甘心进小厂还...
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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