题解 | #满足条件的用户的试卷完成数和题目练习数#

满足条件的用户的试卷完成数和题目练习数

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

select uid, exam_cnt, case when question_cnt is null then 0 else question_cnt end from(select uid from exam_record
    left join examination_info using(exam_id)
    left join user_info using(uid)
    where tag='SQL' and difficulty = 'hard' and level = 7
    group by uid
    having avg(score)>80) 
as uid_cnt
left join (select uid,count(submit_time) as exam_cnt from exam_record
    where Year(submit_time) = 2021 and submit_time is not null
    group by uid
) as exam_cnt_list using(uid)
left join (select uid,count(submit_time) as question_cnt from practice_record
    where Year(submit_time) = 2021 and submit_time is not null
    group by uid) as practice_cnt_list using(uid)

order by exam_cnt, question_cnt desc

全部评论

相关推荐

rbjjj:太杂了吧,同学,项目似乎都没深度,都是api调度耶,分层架构思想没有体现出来了,前端没有前端优化前端工程化体现,后端微服务以及分层架构没体现以及数据安全也没体现,核心再改改,注重于计算机网络,工程化,底层原理吧
点赞 评论 收藏
分享
10-29 15:51
嘉应学院 Java
后端转测开第一人:你把简历的学历改成北京交通大学 去海投1000份发现基本还是没面试
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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