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

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

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

select t0.uid,exam_cnt,ifnull(question_cnt,0) from
(
    select user_info.uid as uid,avg(score) from exam_record join   
    examination_info using(exam_id) 
    join user_info using(uid)
    where user_info.level=7 and difficulty='hard' and tag='SQL' group by user_info.uid  
    having avg(score)>80
) as t0
left join
(
    select uid ,count(*) as exam_cnt from exam_record 
    where  year(submit_time)=2021 group by uid 
) as t1
on t0.uid=t1.uid
left join 
(
    select uid,count(*) as question_cnt from practice_record 
    where  year(submit_time)=2021 group by uid
) as t2
on t1.uid=t2.uid
order by exam_cnt asc,question_cnt desc;

全部评论

相关推荐

友友们,我实在是不太明白,校招的话现在大多也是提前实习,然后转正也是需要考核的,考核通过才能转正,那这跟实习转正有什么区别啊
苦闷的仰泳鲈鱼刷了1...:提前实习,是让你提前熟悉业务的,后续是入职后可以减少试用期的(大部分是包入职的);转正实习,要是hc不够或者其他原因,让你正式offer可能都没有,这个风险很大。 ---个人看法和了解到的。
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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