阿豪不牛
阿豪不牛
全部文章
分类
归档
标签
去牛客网
登录
/
注册
阿豪不牛的博客
全部文章
(共11篇)
题解 | 请按城市对客户进行排序,如果城市为空,则按国家排序
select * from customers_info order by case when city is null then country else city end 学到了,原来order by这里也可以使用case when
2025-04-07
0
72
题解 | 播放量峰值top3高的视频
with video_cnt as ( select a.cid, round( sum( if ( a.s...
2025-04-06
0
155
题解 | 各个部门实际平均薪资和男女员工实际平均薪资
with selected_data as( select department,staff_gender,(normal_salary - dock_salary) as actual_salary from staff_tb as ft inner join salary...
2025-04-06
0
102
题解 | 统计每个产品的销售情况
-- 需要求出每个产品的销售总量、每个产品的购买量(客户ID,购买量、年龄) with product_sale as ( -- 该表输出商品ID,总销售额,单价,月平均销售额 select p.product_id, sum(...
2025-03-21
0
78
题解 | 完成员工考核试卷突出的非领导员工
-- Level1:得到每类试卷的平均用时和平均得分 -- level2:对比每个员工 作答用时与同类平均时长,试卷得分与同类试卷平均分数,并select with avg_situation as ( select eni.tag, ...
2025-03-19
0
110
题解 | 网易云音乐推荐(网易校招笔试真题)
select music_name from ( select distinct music.music_name,music.id from follow inner join ...
2025-03-17
0
111
题解 | 查询连续登陆的用户
select user_id from ( select rt.user_id, lt.log_time, day (lt.log_time) - row_number() over ( ...
2025-03-16
0
124
题解 | 统计所有课程参加培训人次
select sum(a.num) as staff_nums from( select ct.staff_id,floor(bit_length(ct.course)/7/8) as num from cultivate_tb as ct where course is n...
2025-03-09
0
72
题解 | 每个月Top3的周杰伦歌曲
--本问题大致可以用这个思路: --1.筛选条件:用户年龄(18-25)、时间(2022)、歌手(周杰伦)、排名(前三名) --2.所需的函数:YEAR、ROW_NUMBER --3.组装:观察输出可发现,三首歌均为周杰伦的,因此前三个条件可以同时出现,采用子查询的方式,在FROM中把三个表进行连接...
2025-03-08
0
82
题解 | 统计每个学校各难度的用户平均刷题数
select d.university, d.difficult_level, round(count(d.question_id)/count(distinct device_id),4) AS avg_answer_cnt from ( sele...
2025-02-27
1
104
首页
上一页
1
2
下一页
末页