ROCK丶丶
ROCK丶丶
全部文章
题解
归档
标签
去牛客网
登录
/
注册
ROCK丶丶的博客
No Sql Boy
全部文章
/ 题解
(共7篇)
题解 | #得分不小于平均分的最低分#
with t as ( # 这里 over() 是开窗函数,表示将平均值放到一整列上 # 具体参考这个博客:[链接](https://blog.csdn.net/qq_22508585/article/details/79334811?ops_request_misc=%257B%2...
Mysql
2021-12-09
0
440
题解 | #SQL15 统计作答次数#
方法一:子查询 select count(start_time) total_pv, count(submit_time) complete_pv, ( select count(distinct(exam_id)) from exam_record where submit_time is...
Mysql
2021-12-08
0
384
题解 | #SQL14 SQL类别高难度试卷得分的截断平均值#
# 先查一个小表 with t as (SELECT ei.tag, ei.difficulty, er.score FROM examination_info ei, exam_record er where ei.tag = 'SQL' and ei.difficulty = 'hard' an...
Mysql
2021-12-08
0
474
题解 | #SQL39 21年8月份练题总数#
select count(distinct(device_id)) did_cnt, count(question_id) question_cnt from question_practice_detail where Month(date) = '08';
Mysql
2021-12-06
0
353
题解 | #SQL35 浙大不同难度题目的正确率#
SELECT qd.difficult_level, # 这里分子用 sum,求该列上所有值的和;分母用 count,求有多少个非空行 sum(if(qpd.result = 'right', 1, 0)) / count(qpd.question_id) correct_rate # AVG(...
Mysql
2021-12-06
0
470
题解 | #SQL34 统计复旦用户8月练题情况#
首先根据以下代码获得初步结果: select * from user_profile u left JOIN question_practice_detail q # left join on 后面最好只放两者关联条件,不要放单独条件, # 例如 “u.university = '复旦大学'”,...
Mysql
2021-12-02
23
903
题解 | #SQL23 统计每个学校各难度的用户平均刷题数#
首先用以下代码获得多表查询的结果: select * from user_profile u, question_practice_detail qpd, question_detail qd where u.device_id = qpd.device_id and qpd.question_id...
Mysql
2021-11-30
0
450