题解 | #试卷完成数同比2020年的增长率及排名变化#

试卷完成数同比2020年的增长率及排名变化

https://www.nowcoder.com/practice/13415dff75784a57bedb6d195262be7b

select t1.tag,
    exam_cnt_20,exam_cnt_21,
    concat(round((exam_cnt_21-exam_cnt_20)*100/exam_cnt_20,1),'%') as growth_rate,
    rank_20 as exam_cnt_rank_20,
    rank_21 as exam_cnt_rank_21,
    cast(rank_21 as signed)-cast(rank_20 as signed) as rank_delta 
from (
    select tag,exam_cnt_20,
        rank() over (order by exam_cnt_20 desc) as rank_20 
    from (
        select tag,count(submit_time) as exam_cnt_20
        from examination_info as ei,exam_record as er
        where er.exam_id=ei.exam_id
            and year(start_time)=2020
            and submit_time is not null
            and month(start_time)<=6
        group by tag
    ) as t1_1
) as t1
join (
    select tag,exam_cnt_21,
        rank() over (order by exam_cnt_21 desc) as rank_21
    from (
        select tag,count(submit_time) as exam_cnt_21
        from examination_info as ei,exam_record as er
        where er.exam_id=ei.exam_id
            and year(start_time)=2021 
            and submit_time is not null
            and month(start_time)<=6
        group by tag
    ) as t2_1
) as t2
on t1.tag=t2.tag
group by tag
order by growth_rate desc,exam_cnt_rank_21 desc;

全部评论

相关推荐

07-21 18:43
门头沟学院 Java
是暑期都招满了吗
ANEOY:今年感觉真是后端地狱级难度了,从暑期就是这样,前端需求非常大
点赞 评论 收藏
分享
来个厂收我吧:首先,市场侧求职我不是很懂。 但是,如果hr把这份简历给我,我会觉得求职人不适合做产品经理。 问题点: 1,简历的字体格式不统一,排版不尽如人意 2,重点不突出,建议参考star法则写个人经历 3,印尼官方货币名称为印度尼西亚卢比(IDR),且GMV690000印尼盾换算为305人民币,总成交额不高。 4,右上角的意向职位在发给其他公司时记得删除。 5,你所有的经历都是新媒体运营,但是你要投市场营销岗位,jd和简历不匹配,建议用AI+提示词,参照多个jd改一下经历内容。 修改建议: 1,统一字体(中文:思源黑体或微软雅黑,英文数字:time new romans),在word中通过表格进行排版(b站学) 2,校招个人经历权重:实习经历=创业经历(大创另算)>项目经历>实训经历>校园经历 3,请将项目经历时间顺序改为倒序,最新的放最上方。 4,求职方向不同,简历文字描述侧重点也需要不同。
点赞 评论 收藏
分享
06-02 15:53
阳光学院 Java
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
昨天 17:55
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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