首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
AI面试、笔试、校招、雇品
HR免费试用AI面试
最新面试提效必备
登录
/
注册
清风k
获赞
232
粉丝
1
关注
5
看过 TA
14
男
潍坊学院
2022
数据分析师
IP属地:湖北
暂未填写个人简介
私信
关注
拉黑
举报
举报
确定要拉黑清风k吗?
发布(51)
评论
刷题
收藏
清风k
关注TA,不错过内容更新
关注
2021-10-26 14:35
潍坊学院 数据分析师
题解 | #连续两次作答试卷的最大时间窗#
最大时间窗为某一用户的所有做大时间最大值和最小值相差的天数,类似极值。 其历史规律就是该用户作答的平均值,未来的规律就是利用平均值乘以最大时间窗。 select uid,days_window, round(days_window*exam_count/total_days,2) as avg_exam_cnt from (select uid, max(datediff(next_time,start_time))+1 as days_window, count(start_time) as exam_count, datediff(max(start_time),min(start_tim...
0
点赞
评论
收藏
分享
2021-10-26 12:00
潍坊学院 数据分析师
题解 | #第二快/慢用时之差大于试卷时长一半的试卷#
select e.exam_id,e.duration,release_time from (select t.exam_id, max(case when r1=2 then time_diff end) kuai_2, max(case when r2=2 then time_diff end) man_2 from (select *, timestampdiff(minute,submit_time,start_time)&n...
0
点赞
评论
收藏
分享
2021-10-26 11:00
潍坊学院 数据分析师
题解 | #每个6/7级用户活跃情况#
select u.uid as uid, count(distinct act_month) as act_month_total, count(distinct case when year(act_time)=2021 then act_day end) as act_days_2021, count(distinct case when year(act_time)=2021 and tag='exam' then act_day end) as act_days_2021_exam, count(distinct case when year(act_time)=2021 and ta...
0
点赞
评论
收藏
分享
2021-10-25 14:01
潍坊学院 数据分析师
2021-10-25
在牛客打卡5天,今天学习:刷题 7 道/代码提交 17 次
每日监督打卡
0
点赞
评论
收藏
分享
2021-10-25 10:25
潍坊学院 数据分析师
题解 | #试卷发布当天作答人数和平均分#
select i.exam_id, count(distinct e.uid) as uv, round(avg(e.score),1)as avg_score from user_info u join exam_record e on u.uid=e.uid join examination_info i on e.exam_id=i.exam_id where i.tag='SQL' and u.level>5 and date_format(i.release_time,'%Y%m%d')=date_format(e.start_time,'%Y%m%d') group by i...
0
点赞
评论
收藏
分享
2021-10-24 15:04
潍坊学院 数据分析师
我醉了,最近做牛客SQL总是报与题目无关的错误,牛客出BUG了吗?
2021-10-24
在牛客打卡4天,今天学习:刷题 5 道/代码提交 20 次
每日监督打卡
0
点赞
评论
收藏
分享
2021-10-24 11:59
潍坊学院 数据分析师
题解 | #月总刷题数和日均刷题数#
1.先分别取出每个月的天数和年份,这里用到的是dayofmonth和date_format 然后分别统计每个月的刷题总数,和日均刷题数, 最后利用with rollup 进行统计,with rollup所在的行为'2021汇总' 利用coalesce函数添加‘2021汇总’ 一般主流数据库系统都支持该coalesce函数 该函数主要用来进行空值处理 select coalesce(year_mon,'2021汇总') as submit_month, count(question_id) as month_q_cnt, round(count(question_id)/max(t.days_m...
娴儿0128:
coalesce(year_mon,'2021汇总') 的意思是说year_mon是null才会返回2021汇总吗?date_format(submit_time,'%Y%m') as year_mon 这个怎么会有 null呢?表里没有null,date_format出来怎么有null?
0
点赞
评论
收藏
分享
2021-10-23 11:36
潍坊学院 数据分析师
题解 | #SQL类别高难度试卷得分的截断平均值#
select f.tag,f.difficulty, round((sum(e.score)-max(e.score)-min(e.score))/(count(e.score)-2),1) as clip_avg_score from exam_record e inner join examination_info f on e.exam_id=f.exam_id where f.tag='SQL' and f.difficulty='hard';
0
点赞
评论
收藏
分享
2021-10-23 10:46
潍坊学院 数据分析师
题解 | #创建一张新表#
create table user_info_vip( id int(11) not null primary key auto_increment comment '自增ID', uid int(11) not null unique key comment '用户ID', nick_name varchar(64) comment '昵称', achievement int(11)&...
清风k:
客户端默认编码是GBK,指定mysql服务器编码utf8,避免乱码.
0
点赞
评论
收藏
分享
2021-10-23 10:34
潍坊学院 数据分析师
题解 | #删除记录(三)#
truncate table exam_record; truncate table 在功能上,与不带where字句的delete语句相同;二者均删除表中的全部行,但truncate table 比delete速度更快,且使用的系统和事务日志资源少。 truncate 删除表中的所有行,但表的结构及其列,约束,索引等保持不变。新行标识所用的技术值重置为该列的种子。如果想保留标识计数值,轻盖拥delete 。如果要删除表定义及其数据,请使用drop table 语句。
0
点赞
评论
收藏
分享
2021-10-22 14:29
潍坊学院 数据分析师
2021-10-22
在牛客打卡3天,今天学习:刷题 11 道/代码提交 13 次
每日监督打卡
0
点赞
评论
收藏
分享
2021-10-22 14:27
已编辑
潍坊学院 数据分析师
题解 | #删除记录(一)#
delete from exam_record where timestampdiff(minute,start_time,submit_time)<5 and score<60; timestampdiff 时间差函数,查询两个时间之间的差值,有参数设置, 可以精确到天(day) 小时(hour) 分钟(minute) 和秒(second) 而datediff函数,返回值是相差的天数,不能定位到小时和分钟秒数。
0
点赞
评论
收藏
分享
2021-10-22 11:32
潍坊学院 数据分析师
题解 | #插入记录(三)#
在插入时,系统表中已有exam_id=9003,首先应该应该将其删除,在插入 delete from examination_info where exam_id=9003; insert into examination_info (id,exam_id,tag,difficulty,duration,release_time) values(default,9003,'SQL','hard',90,'2021-01-01 00:00:00');
0
点赞
评论
收藏
分享
2021-10-21 20:36
潍坊学院 数据分析师
2021-10-21
在牛客打卡2天,今天学习:刷题 10 道/代码提交 24 次
每日监督打卡
0
点赞
评论
收藏
分享
2021-10-21 20:36
潍坊学院 数据分析师
题解 | #浙大不同难度题目的正确率#
select * from (select q2.difficult_level, sum(if (q1.result='right',1,0))/count(q1.question_id) as correct_rate from user_profile u inner join question_practice_detail q1 on u.device_id=q1.device_id inner join question_detail q2 on q1.question_id=q2.question_id where u.university='浙江大学' group by q2....
0
点赞
评论
收藏
分享
1
2
3
4
创作者周榜
更多
关注他的用户也关注了:
牛客网
牛客网在线编程
牛客网题解
牛客企业服务