呱呱呱zzz
呱呱呱zzz
全部文章
题解
归档
标签
去牛客网
登录
/
注册
呱呱呱zzz的博客
全部文章
/ 题解
(共15篇)
题解 | #统计有未完成状态的试卷的未完成数和未完成率#
select exam_id, sum(if(score is null, 1, 0))as incomplete_cnt, round(sum(if(score is null, 1, 0)) / count(uid) , 3) as complete_rate from exam_record ...
Mysql
2022-05-15
1
334
题解 | #每月及截止当月的答题情况#
解题思路: 1.判断哪些为最新用户 IF(start_time=MIN(start_time)OVER(PARTITION BY uid),1,0) 2.每月试卷作答月活用户数 count(),新增用户数sum() 3.截至当月最大新增 max() over(),累计用户数 sum() over()...
Mysql
2022-05-15
1
264
题解 | #每份试卷每月作答数和截止当月的作答总数。#
1.先计算每月作答数count(*) 2.再计算截至当月sum() over() select *, sum(month_cnt) over(partition by exam_id order by start_month) from ( select exam_id, DATE_FORMAT(s...
Mysql
2022-05-15
2
349
题解 | #对试卷得分做min-max归一化#
思路: 1.取高难度试卷,最高分最低分 两表关联difficulty ='hard',max(score) over(partiton by exam_id) 2.归一化得分,乘100(只有一条记录则为得分)if(max=min,score,(score-min)/(max-min)) 3.归一化分...
Mysql
2022-05-15
1
309
题解 | #试卷完成数同比2020年的增长率及排名变化#
1.2021年上半年做完次数,排名 2.2020年上半年做完次数,排名 3.对比增长率,排名变化 with t1 as( select exam_id,count()cnt1, rank() over(order by count() desc) rank1 from exam_record whe...
Mysql
2022-05-06
2
326
首页
上一页
1
2
下一页
末页