攸四
攸四
全部文章
分类
归档
标签
去牛客网
登录
/
注册
攸四的博客
全部文章
(共40篇)
题解 | 牛客每个人最近的登录日期(三)
服了我做的好复杂 with u as (select user_id,date,dense_rank()over(partition by user_id order by date)as rk from login l), a as (select user_id,date,rk from u ...
2025-05-26
0
68
题解 | 统计所有课程参加培训人次
超暴力 select sum(case when course is null then 0 when course like '%,%,%' then 3 when course like '%,%' then 2 when...
2025-05-25
0
65
题解 | 推荐内容准确的用户平均评分
group by 去重 with a as( select rec_user,rec_info_l from recommend_tb rt join user_action_tb uat on rt.rec_user = uat.user_id and rt.rec_info_l = uat.h...
2025-05-24
0
59
题解 | 电话号码格式校验
select id, name, phone_number from contacts where (phone_number like '__________' or phone_number like'___-___-____') and ph...
2025-05-19
24
129
题解 | 浙大不同难度题目的正确率
#沿用上一题热评第一大佬的思路# select qd.difficult_level, sum(if(qpd.result='right',1,0))/sum(if(qpd.result='right',1,1)) as correct_rate from user_profile u...
2025-05-19
0
55
题解 | 查看不同年龄段的用户明细
#case when解答# select device_id, gender, case when age <20 then '20岁以下' when age between 20 and 24 then '20-24岁' ...
2025-05-19
0
56
题解 | 统计每个用户的平均刷题数
注意:round四位小数、先where再group by select up.university, qd.difficult_level, round(count(qpd.question_id)/count(distinct qpd.device_id),4) as ...
2025-05-19
0
59
题解 | 统计每个学校的答过题的用户的平均答题数
select up.university, round(count(qpd.question_id)/count(distinct qpd.device_id), 4) as avg_answer_cnt from question_practice_detail qpd join u...
2025-05-19
0
59
题解 | 分组计算练习题
select gender,university, count(device_id) as user_num, avg (active_days_within_30) as avg_active_day, avg (question_cnt) as avg_...
2025-05-19
0
75
题解 | 操作符混合运用
select device_id,gender,age,university,gpa from user_profile where gpa > 3.5 and university = '山东大学' union select device_id,gender,age,university,g...
2025-05-19
0
64
首页
上一页
1
2
3
4
下一页
末页