题解 | #得分不小于平均分的最低分#

得分不小于平均分的最低分

https://www.nowcoder.com/practice/3de23f1204694e74b7deef08922805b2

#方法一
select
    score min_score_over_avg
FROM
    exam_record
join examination_info
on examination_info.exam_id=exam_record.exam_id
where
    score >= (
        select
            
            avg(score)
        from
            exam_record er
             left join examination_info ei on er.exam_id = ei.exam_id
        where
            tag = 'SQL'
        and er.score is not null
    )
and tag='SQL'
order by score
limit 1;

#方法二
select
    min(t.score) min_score_over_avg
FROM
    (
        select
            er.score,
            avg(er.score) over() avg_score
        
        from
            exam_record er
            left join examination_info ei on er.exam_id = ei.exam_id
        where
            ei.tag = 'SQL'
        and er.score is not null
    )t
where t.score >= t.avg_score;



#方法三
select
    min(t.score) min_score_over_avg
from (
    select 
        avg(er.score) over() avg_score,
        er.score
    from  exam_record er
    left join examination_info ei
    on er.exam_id = ei.exam_id
    where tag = 'SQL'
    and er.score is not null
)t
where  t.score>=t.avg_score; 





全部评论

相关推荐

learYuan:🐕看了都摇头
点赞 评论 收藏
分享
群星之怒:1.照片可以换更好一点的,可以适量P图,带一些发型,遮住额头,最好穿的正式一点,可以适当P图。2.内容太少。建议添加的:求职意向(随着投递岗位动态更改);项目经历(内容太少了建议添加一些说明,技术栈:用到了什么技术,还有你是怎么实现的,比如如何确保数据传输稳定的,角色注册用到了什么技术等等。)项目经历是大头,没有实习是硬伤,如果项目经理不突出的话基本很难过简历筛。3.有些内容不必要,比如自我评价,校内实践。如果实践和工作无关千万别写,不如多丰富丰富项目。4.排版建议:建议排版是先基础信息,然后教育背景(要突出和工作相关的课程),然后专业技能(一定要简短,不要长篇大论,写你会什么,会的程度就可以),然后是项目经历(一定要详细,占整个简历一定要超过一半,甚至超过百分之70都可以)。最后如果有一部分空白的话可以填补上校内获得的专业相关的奖项,没有就写点校园经历和自我评价。5.技术一定要够硬,禁得住拷打。还有作息尽量保证正常,不要太焦虑。我24双非本科还是非科班,秋招春招各找了一段实习结果都没有转正,当时都想噶了,最后6月份在校的尾巴也找到一份工作干到现在,找工作有时很看运气的不要急着自我否定。 加油
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务