题解 | #筛选昵称规则和试卷规则的作答记录#

筛选昵称规则和试卷规则的作答记录

https://www.nowcoder.com/practice/1c5075503ccf4de1882976b2fff2c072

with t1 as (
    select uid
    from user_info
    where nick_name REGEXP '^牛客[0-9]*号$'
    or nick_name REGEXP '^[0-9]+$'
),
t2 as (
    select exam_id
    from examination_info
    where tag REGEXP '^c'
),
t3 as (
    select uid, exam_id, score
    from exam_record
    where score IS NOT NULL
    and uid in (
        select uid 
        from t1
    )
    and exam_id in (
        select exam_id
        from t2
    )
)
select uid, exam_id, round(AVG(score), 0) as avg_score
from t3
group by uid, exam_id
order by uid, avg_score;

全部评论
正则表达式的使用
点赞 回复 分享
发布于 2023-08-11 19:13 江苏

相关推荐

爱吃烤肠的牛油最喜欢...:50K是ssp了估计,ssp的人家多厉害都不用说,每年比例大概在百分之5左右
点赞 评论 收藏
分享
小肥罗:此乃引蛇出洞之计,勾出你想去杭州的原因再告诉你不在杭州,让你打脸,自己离开。好一招抛砖引玉,虾仁猪心。你回复:计划去杭州,但我心中第一选择是宁波~巧了! 这计名叫“阿Q精神胜利法之厚脸皮不要脸我不尴尬谁爱尴尬谁尴尬去”之计!克制一切!
这个工作能去吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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