首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
AI面试、笔试、校招、雇品
HR免费试用AI面试
最新面试提效必备
登录
/
注册
无上清颜
获赞
1360
粉丝
2
关注
14
看过 TA
105
男
门头沟学院
2023
数据分析师
IP属地:山东
摸鱼界扛把子
私信
关注
拉黑
举报
举报
确定要拉黑无上清颜吗?
发布(63)
评论
刷题
收藏
无上清颜
关注TA,不错过内容更新
关注
2022-02-19 11:21
门头沟学院 数据分析师
2022.02.19 在牛客打卡14天!
0
点赞
评论
收藏
分享
2022-02-19 10:50
门头沟学院 数据分析师
题解 | #某乎问答回答过教育类问题的用户里有多少用户回答过职场类问题#
先筛选出回答过Education的用户(子查询),在此基础上筛选回答过Career的用户 select count(distinct author_id) as num from issue_tb t join answer_tb t1 using(issue_id) where author_id in (select author_id from issue_tb t join answer_tb t1 using(issue_id) where issue_type = 'Education') and issue_type = 'Career'
0
点赞
评论
收藏
分享
2021-12-23 15:14
已编辑
门头沟学院 数据分析师
题解 | #某店铺的各商品毛利率及店铺整体毛利率#
select '店铺汇总' as pproduct_id,concat(round((1-sum(in_price*cnt)/sum(price*cnt))*100,1),'%') as profit_rate from tb_product_info t join tb_order_overall t1 join tb_order_detail t2 on t.product_id = t2.product_id and t1.order_id = t2.order_id where shop_id=901 and date(event_time)>='20211001' union ...
0
点赞
评论
收藏
分享
2021-12-23 10:10
门头沟学院 数据分析师
题解 | #统计2021年10月每个退货率不大于0.5的商品各项指标#
select product_id,round(sum(if_click)/count(1),3) as ctr ,round(sum(if_cart)/sum(if_click),3) as cart_rate ,round(sum(if_payment)/sum(if_cart),3) as payment_rate ,round(sum(if_refund)/sum(if_payment),3) as refund_rate from tb_user_event where DATE_FORMAT(event_time,"%Y%m") = '202110' group by produc...
0
点赞
评论
收藏
分享
2021-12-23 09:54
门头沟学院 数据分析师
2021.12.23 在牛客打卡13天!
0
点赞
评论
收藏
分享
2021-12-23 09:52
门头沟学院 数据分析师
题解 | #计算商城中2021年每月的GMV#
select date_format(event_time,"%Y-%m") as month,sum(case when status in (0,1) then total_amount else 0 end) as GMV from tb_order_overall where year(event_time) = 2021 group by month having GMV>100000 order by GMV
0
点赞
评论
收藏
分享
2021-12-23 09:42
门头沟学院 数据分析师
题解 | #连续签到领金币#
with t as ( select uid,date(in_time) as dint, date(in_time)-dense_rank()over(partition by uid order by in_time) as start_time from tb_user_log where artical_id=0 and sign_in=1 and date(in_time) between '2021-07-07' and '2021-10-31' ) select uid,date_format(dint,"%Y%m") as month,sum(case rn%7 when 3 ...
0
点赞
评论
收藏
分享
2021-12-20 15:23
门头沟学院 数据分析师
2021.12.20 在牛客打卡12天!
0
点赞
评论
收藏
分享
2021-12-20 15:22
门头沟学院 数据分析师
题解 | #每天的日活数及新用户占比#
-- 临时表————每个用户第一次登陆数据 with t as( select distinct first_login_time,count(uid)over(partition by first_login_time) as num from (select uid,min(date(in_time)) as first_login_time from tb_user_log group by uid) t ), -- 临时表————日活 m as ( select dtime as dt,count(1) as dau from (select uid,date(in_time) as ...
0
点赞
评论
收藏
分享
2021-12-20 09:43
已编辑
门头沟学院 数据分析师
逻辑清晰
with t as ( select uid,max(date(in_time))over(partition by uid) as max_part_time, min(date(in_time))over(partition by uid) as min_part_time, date_add(max(date(out_time))over(),interval -6 day) as 7_time, date_add(max(date(out_time))over(),interval -29 day) as 29_time, (select count(distinct uid) fro...
0
点赞
评论
收藏
分享
2021-12-15 10:16
门头沟学院 数据分析师
2021.12.15 在牛客打卡11天!
0
点赞
评论
收藏
分享
2021-12-20 09:20
已编辑
门头沟学院 数据分析师
题解 | #2021年11月每天新用户的次日留存率#
-- 第一步:建立临时表,利用窗口函数lead,取出每个日期对应的下一个日期数据(算次日留存)。因为可能会涉及跨天活跃问题,所以也需要out_time with t as ( select uid,date(in_time) as dint,date(out_time) as dout, lead(date(in_time))over(partition by uid order by in_time) as ldint from tb_user_log ) -- 第二步:首先取出每个uid对应的首日(最小)登录日期,继而可以算留存率。注:要求的是2021年11月的留存率 select din...
christiney...:
前排几个用union解决跨日的都不严谨,一旦登陆时间是从20211101到20211103 ,即中间隔了一天的就会捞不出来。感觉这个答案改改就能兼容这种奇葩情况了,把原本datediff(dout,dint)=1 改成 datediff(dout,dint)>=1,加个大于号即可。
0
点赞
评论
收藏
分享
2021-12-14 08:21
门头沟学院 数据分析师
2021.12.14 在牛客打卡10天!
0
点赞
评论
收藏
分享
2021-12-13 09:31
门头沟学院 数据分析师
题解 | #2021年11月每天的人均浏览文章时长#
select date(out_time) as dt,round(sum(TIMESTAMPDIFF(second,in_time,out_time))/count(distinct uid),1) as avg_view_len_sec from tb_user_log where artical_id <>0 and DATE_FORMAT(out_time,"%Y%m")=202111 group by dt order by avg_view_len_sec
0
点赞
评论
收藏
分享
2021-12-13 09:25
门头沟学院 数据分析师
第一次用到rank函数
with t as ( select t.artical_id,t.out_time,t1.in_time,TIMESTAMPDIFF(second,t1.in_time,t.out_time) as time_gap, RANK()over(partition by artical_id order by out_time)-1 as rn from tb_user_log t join tb_user_log t1 on t.artical_id=t1.artical_id where t.artical_id<>0 and t1.artical_id<>0 ) s...
0
点赞
评论
收藏
分享
1
2
3
4
5
创作者周榜
更多
关注他的用户也关注了:
牛客网
牛客网在线编程
牛客网题解
牛客企业服务