题解 | #各用户等级的不同得分表现占比#

各用户等级的不同得分表现占比

https://www.nowcoder.com/practice/ebff819fd38c46db8a42dfe43ca7b33a

with tb as(
select score,level, 
count(level) over(partition by level) as answer_cnt,  #添加记录每个等级用户答卷数量
case when score>= 90 then '优'
     when score<90 and score >=75 then '良'
     when score<75 and score >=60 then '中'
     else '差' end as score_grade
from exam_record 
left join user_info using(uid)
where score is not null)

select level, score_grade, 
round(count(level)  / answer_cnt ,3)as ratio
from tb
group by level,score_grade
order by level desc,ratio desc

全部评论

相关推荐

08-08 16:33
唐山学院 Java
职场水母:首先,简历太长,对于实习和应届找工作,hr一眼扫的是学历,技术看实习,你写的技术栈字太多了,尽量用一句话概括不用写那么详细,技术面的时候会问的,而且技术栈都会在实习或者项目里体现,你要做的是,把你的简历浓缩为一页,删除没用的东西,比如实践经历,自我评价,这些纯废话,没用,专业技能写的太离谱,你真的熟练掌握了吗,建议都写熟悉,找工作和写论文不一样,追求的是干练和实用,把实习经历和项目提前,把掌握的技术栈写到最后,然后去找实习,
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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