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

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

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

  • SELECT e.exam_id , count(DISTINCT uid ) as uv ,ROUND(avg(score) ,1) AS avg_score
  • FROM
  • (SELECT uid, ei.exam_id ,submit_time ,score
  • FROM examination_info ei LEFT JOIN exam_record er
  • ON ei.exam_id = er.exam_id
  • WHERE tag = 'SQL' and DATE(submit_time) = DATE(release_time) ) AS e
  • WHERE uid IN (SELECT uid FROM user_info WHERE level > 5 )
  • GROUP BY e.exam_id
  • ORDER BY uv DESC , avg_score
全部评论

相关推荐

头像
11-09 17:30
门头沟学院 Java
TYUT太摆金星:我也是,好几个华为的社招找我了
点赞 评论 收藏
分享
09-29 11:19
门头沟学院 Java
点赞 评论 收藏
分享
1 收藏 评论
分享
牛客网
牛客企业服务