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

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

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

select uid,exam_cnt,if(question_cnt is null,0,question_cnt)
from (
select uid,count(submit_time) as exam_cnt
from exam_record
where uid in (select u.uid
            from user_info u
            join exam_record e
            using (uid)
            join examination_info
            using(exam_id )
            where level=7 and tag='SQL'
            group by u.uid
            having avg(score)>80)
     and year(submit_time)=2021
group by uid) as t1
left join (
select uid,count(submit_time) as question_cnt
from practice_record
where uid in (select u.uid
            from user_info u
            join exam_record e
            using (uid)
            join examination_info
            using(exam_id )
            where level=7 and tag='SQL'
            group by u.uid
            having avg(score)>80)
     and year(submit_time)=2021
group by uid) as t2
using(uid)
order by exam_cnt ,question_cnt desc




全部评论

相关推荐

点赞 评论 收藏
分享
01-07 15:50
四川大学 Java
看日出看日落:好好背八股,做算法。我身边跟你bg差不多的基本都大厂暑期
点赞 评论 收藏
分享
KPLACE:首先是板面看起来不够,有很多奖,比我厉害。项目要精减,大概详细描述两到三个,要把技术栈写清楚,分点,什么算法,什么外设,怎么优化,不要写一大堆,分点,你写上去的目的,一是让别人知道你做了这个知识点,然后在面试官技术面的时侯,他知道你会这个,那么就会跟你深挖这个,然后就是个人评价改为专业技能
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务