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

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

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

SELECT exam_id,count(distinct uid) uv,round(avg(score),1) avg_score from (
		SELECT er.*,ei.tag,ei.difficulty from exam_record er
		join examination_info ei on er.exam_id=ei.exam_id where tag = 'SQL' and DATE_FORMAT(er.submit_time,"%Y%m%d")=DATE_FORMAT(ei.release_time,"%Y%m%d") and
		uid in (
				SELECT uid FROM user_info where level>5)
)t1 
GROUP BY tag,exam_id order by uv desc,avg_score asc;

全部评论

相关推荐

冲芭芭拉鸭:你这图还挺新,偷了。
投递美团等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务