橙子654
橙子654
全部文章
分类
归档
标签
去牛客网
登录
/
注册
橙子654的博客
全部文章
(共10篇)
题解 | 最受欢迎的top3课程
with t1 as( select cid ,score ,start_time ,round(timestampdiff(minute,start_time,end_time),3) len from play_record_tb ) ,t2 as( select cid ,avg(score)...
2025-05-05
0
28
题解 | 统计每个产品的销售情况
# 年销售总量 with t as (select product_id ,round(sum(quantity)) total_quantity from orders group by product_id) #月销售额及排序 , t1 as (select product_id ,month(...
2025-05-04
0
35
题解 | 商品销售总额分布(case when与if())
# 需要小明展示商品名称为'anta'的商品各个支付渠道的分布(包括脏数据数量),以支付渠道的次数的逆序排列返回 # 注: # 只有select步骤的数据有pay_method字段; # 如果select中pay_method为''则以error标记pay_method为脏数据; select pa...
2025-05-04
0
31
题解 | 完成员工考核试卷突出的非领导员工
# 请你找到作答每类试卷的突出非领导员工,并输出他们的 # 员工ID(emp_info),员工等级(emp_info)和突出试卷类别(examination_info) # 并按照员工ID升序排序,若某员工两类试卷都突出,则按照试卷ID升序排序。 # 9001试卷员工id,分数,平均分,时间,平均...
2025-05-04
0
41
题解 | 短视频直播间晚上11-12点之间各直播间的在线人数
with tb as( #2.把不满足if条件的user_id的记录过滤,并对同一直播间多次进入的同一用户用group by去重(人次转为人数) select user_id,room_id from( #1.查找进入和退出直播间时间在23到24点之间的user_id和对应的直播间id SELE...
2025-04-28
0
40
题解 | 网易云音乐推荐(网易校招笔试真题)
select music_name from ( # 查询关注者喜欢的歌曲id(过滤1用户喜欢的歌曲id) select l1.music_id flove_id from ( #查询1用户的关注者id select follower_id from follow where user_...
2025-04-28
0
41
题解 | 每天登陆最早的用户的内容喜好
select log_day ,t.user_id user_id ,hobby from( select date(log_time) log_day ,user_id ,rank() over(partition by date(log_time) order by log_time) ra...
2025-04-28
0
38
题解 | 统计各岗位员工平均工作时长
# 这题的数据挺有意思,会有人上班没打卡,下班打卡的情况。 select post ,round(sum(unix_timestamp(last_clockin)-unix_timestamp(first_clockin))/3600/count(*),3) work_hours from staf...
2025-04-27
0
40
题解 | 获取指定客户每月的消费额
select date_format(t_time,'%Y-%m') time # substr(t_time,1,7) time ,sum(t_amount) total from trade t1 left join customer t2 on t1.t_cus=t2.c_id where c...
2025-04-25
0
35
题解 | 分析客户逾期情况
select pay_ability, concat(round( 100.0*(sum(if (overdue_days is not NULL, 1, 0)) / count(*)),1 ),'%') overdue_ratio from loan...
2025-04-25
0
36