首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
搜索
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
在线笔面试、雇主品牌宣传
登录
/
注册
nanc777
获赞
65
粉丝
2
关注
8
看过 TA
4
男
中国农业大学
2022
数据分析师
IP属地:上海
暂未填写个人简介
私信
关注
拉黑
举报
举报
确定要拉黑nanc777吗?
发布(15)
评论
刷题
nanc777
关注TA,不错过内容更新
关注
2021-10-25 20:20
中国农业大学 数据分析师
题解 | #0级用户高难度试卷的平均用时和平均得分#
select uid ,round(sum(score)/count(*),0) as avg_score ,round(avg(case when score is not null then timestampdiff(minute,start_time,submit_time) else duration end),1) as avg_time_took from exam_record e1 join examination_info e2 on e1.exam_id=e2.exam_id where uid in (select uid from user_info where...
0
点赞
评论
收藏
分享
2021-10-25 20:02
中国农业大学 数据分析师
题解 | #统计有未完成状态的试卷的未完成数和未完成率#
select exam_id ,count(case when score is null then 1 else null end) as incomplete_cnt ,ROUND(count(case when score is null then 1 else null end)/count(*),3) as incomplete_rate from exam_record group by exam_id having incomplete_rate<>0
0
点赞
评论
收藏
分享
2021-10-25 19:54
中国农业大学 数据分析师
题解 | #每月及截止当月的答题情况#
select start_month,mau,month_add_uv ,max(month_add_uv) over(order by start_month) as max_month_add_uv ,sum(month_add_uv) over(order by start_month) as cum_sum_uv from ( select start_month ,count(distinct uid) as mau ,count(distinct case when start_month=first_month then uid else null en...
0
点赞
评论
收藏
分享
2021-10-25 17:41
中国农业大学 数据分析师
题解 | #对试卷得分做min-max归一化#
select uid,exam_id ,ifnull(round(avg(100*(score-min_score)/(max_score-min_score)),0),0) as avg_new_score from ( select * ,max(score) over(partition by exam_id) as max_score ,min(score) over(partition by exam_id) as min_score from exam_record where exam_id in ( select ex...
0
点赞
评论
收藏
分享
2021-10-25 09:16
中国农业大学 数据分析师
题解 | #近三个月未完成试卷数为0的用户完成情况#
having语句筛选出完成试卷数和作答试卷数相同的记录,因为这个条件意味着用户没有未完成的试卷 select uid,count(score) as exam_complete_cnt from ( select * ,date_format(start_time,"%Y%m") as month ,dense_rank() over(partition by uid order by date_format(start_time,"%Y%m") desc) as rk from exam_record ) t where rk <=3 g...
0
点赞
评论
收藏
分享
2021-10-25 08:59
中国农业大学 数据分析师
题解 | #连续两次作答试卷的最大时间窗#
select uid,max(days_window) as days_window ,round(max(days_window)*max(sum_exam_cnt)/(1+timestampdiff(day,max(min_day),max(max_day))),2) as avg_exam_cnt from ( select uid ,max(days_window)over(partition by uid order by days_window desc) as days_window ,count(exam_id) over(partition by u...
0
点赞
评论
收藏
分享
2021-10-25 01:20
中国农业大学 数据分析师
题解 | #第二快/慢用时之差大于试卷时长一半的试卷#
第一步:先把所有记录的时间差及其大小顺序计算出来 第二步:找到每个exam第二快kuai_2和第二慢man_2的时间差 第三步:将第二步找到的kuai_2-man_2计算出来,找到大于0.5的duration的数据 select e.exam_id,e.duration,release_time from ( select t.exam_id ,max(case when r1=2 then time_diff end) as kuai_2 ,max(case when r2=2 then time_diff end) as man_2 from ...
Bamboo515:
select t.exam_id ,max(case when r1=2 then time_diff end) as kuai_2 ,max(case when r2=2 then time_diff end) as man_2 请问 为啥用max啊,是有重复的意思吗
0
点赞
评论
收藏
分享
2021-10-24 20:35
中国农业大学 数据分析师
题解 | #作答试卷得分大于过80的人的用户等级分布#
select level,count(distinct e.uid) as level_cnt from exam_record e join user_info u on e.uid=u.uid where e.exam_id IN ( select exam_id from examination_info where tag="SQL" ) and e.score>80 group by level order by level_cnt desc,level desc
0
点赞
评论
收藏
分享
2021-10-24 20:30
中国农业大学 数据分析师
题解 | #试卷发布当天作答人数和平均分#
select t.exam_id,count(distinct e1.uid) as uv ,round(avg(e1.score),1) as avg_score from exam_record e1 join ( select exam_id,release_time from examination_info where tag="SQL" ) t on t.exam_id = e1.exam_id join user_info e2 on e1.uid=e2.uid where e2.level>5 and date_format(t.relea...
0
点赞
评论
收藏
分享
2021-10-24 20:15
中国农业大学 数据分析师
题解 | #月均完成试卷数不小于3的用户爱作答的类别#
select e2.tag as tag,count(*) as tag_cnt from exam_record e1 right join examination_info e2 on e1.exam_id=e2.exam_id where e1.uid in ( select uid from exam_record where submit_time is not null group by uid having count(*)/count(distinct month(start_time))>=3 ) group by e1....
0
点赞
评论
收藏
分享
2021-10-20 18:40
中国农业大学 数据分析师
题解 | #统计作答次数#
sum+if或者sum+case when yyds!! select count(*) as total_pv ,count(submit_time) as complete_pv ,count(distinct case when submit_time is not null and score is not null then exam_id end) as complete_exam_cnt from exam_record
0
点赞
评论
收藏
分享
2021-10-16 16:22
已编辑
中国农业大学 数据分析师
求一个补录群
秋招0offer选手在这里给各位xdjm鞠躬了! 那我来建个群吧 qq:974901169
0
点赞
评论
收藏
分享
2021-10-06 16:39
中国农业大学 数据分析师
题解 | #商品交易(网易校招笔试真题)#
select g.*,t.total from ( select goods_id ,sum(count) as total from trans group by goods_id having sum(count)>20 ) t join goods g on g.id=t.goods_id where g.weight<50
0
点赞
评论
收藏
分享
2021-08-24 00:08
中国农业大学 数据分析师
题解 | #查找在职员工自入职以来的薪水涨幅情况#
建立两个临时表,分别计算每一天的新增用户和第二天仍旧进入的用户数目怒 #第一步:计算每天的新增用户 with t1 as ( select date,count(first_date) as new from login l left join ( select user_id,min(date) as first_date from login group by user_id )t on l.user_id=t.user_id and l.date=t.first_date group by date ), #第二步:计算下一天的留存用户数目 #就是第一天登录,第二天也登录的用户...
0
点赞
评论
收藏
分享
2021-08-21 14:56
中国农业大学 数据分析师
题解 | #查找在职员工自入职以来的薪水涨幅情况#
with temp as(select s.*,hire_datefrom salaries sjoin employees eon e.emp_no=s.emp_no),t as(select * ,max(case when from_date=hire_date then salary end) start_sal ,max(case when to_date='9999-01-01' then salary end) end_salfrom tempgroup by emp_no) select emp_no,end_sal-start_sal as growthfrom ...
0
点赞
评论
收藏
分享
1
关注他的用户也关注了:
牛客网
牛客企业服务