刘青丰
刘青丰
全部文章
分类
归档
标签
去牛客网
登录
/
注册
刘青丰的博客
全部文章
(共14篇)
题解 | 医院门诊复诊率与抗生素用药占比统计
-- 理解题目: -- 1.每个科室,说明没有记录的科室也要列出来 -- 2.时间限定为2024年02月-where visit_date >= '2024-02-01' and visit_date <= '2024-02-29'(该限定方法性能最优) -- 3.就诊人次-count(...
2025-12-22
0
25
题解 | 统计骑手信息
with t1 as ( select zone_id ,zone_name ,count( case when left(order_time,7) = '2023-02' and (hour(order_time) between 11 and 13 or...
2025-12-17
0
24
题解 | 饿了么需要分析不同配送员在不同天气条件下的配送效率和用户投诉情况
-- 首先把符合条件的配送员找到:①平均配送速度大于 20 ②投诉率低于50%(这里的投诉率指的是总的投诉率,不区分天气) -- 找到符合条件的所有配送员后,把他们的订单数据再按天气分组求平均配送时间和总配送次数 select weather_type ,round(avg(delivery...
2025-12-05
0
28
题解 | 了解 2023 年全年所有商品的盈利情况
select product_id ,round(sum((unit_price - purchase_price)*quantity),2) as total_profit ,round((avg(unit_price) - purchase_price)/purchase_pri...
2025-12-05
0
23
题解 | 实习广场投递简历分析(三)
# 1.先把2025年和2026年的数据分别求出来 # 2.再左连接2025年的数据,两个临时表的连接条件有两个:一是job一致,二是月份一致; with t1 as ( select job,left(date,7) as mon,sum(num) as cnt from resume_info ...
2025-11-24
1
27
题解 | 牛客每个人最近的登录日期(五)
-- 先把新用户找出来(只包含有新用户的日期) with new_u as ( select user_id,min(date) as first_day from login group by 1 ), -- 如果新用户第二天登录就打个标记为1,否则为0 mark_tab as ( select ...
2025-10-25
1
36
题解 | 计算用户的平均次日留存率
with temp as ( select distinct t1.device_id,t1.date,(case when t2.date then 1 else 0 end) as mark from question_practice_detail t1 left join question_...
2025-10-24
1
25
题解 | 短视频直播间晚上11-12点之间各直播间的在线人数
select u.room_id,room_name,count(distinct user_id) as user_count from user_view_tb as u join room_info_tb as r using(room_id) where out_time >= '23...
2025-03-16
1
83
题解 | 被重复观看次数最多的3个视频
with t1 as ( select uid,cid,count(*) as num from play_record_tb group by uid,cid having num >1), --因为一个人至少看过2次才算,所以过滤掉一人只看过一次的记录 t2...
2025-03-16
1
94
题解 | 支付间隔平均值
select cast(avg(abs(timestampdiff(second,o.logtime,s.logtime))) as unsigned) as gap from order_log as o join select_log as s using(order_id)
2025-03-13
1
62
首页
上一页
1
2
下一页
末页