牛客362424617号
牛客362424617号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客362424617号的博客
全部文章
(共19篇)
题解 | #未完成试卷数大于1的有效用户#
发现有两套不同的输入,一套跟示例差不多的记录,另一套行数要多不少 比较奇怪的点:我这套题有一行记录有分数,没有提交时间,导致之前一直跑不过,后改成判定提交时间是否NULL值就成功了.. select uid, sum(if(submit_time is null , 1 , 0)...
2023-03-20
1
227
题解 | #平均活跃天数和月活人数#
select concat (year (submit_time), "0", month (submit_time)) month, round( count(distinct uid, left (submit_time, 10)) / count(distinc...
2023-03-19
1
227
题解 | #得分不小于平均分的最低分#
select min(score) from( select score, avg(score) over() avg_score from exam_record t1 left join examination_info t2 on t1.exam_id = t2.exam_id where t...
2023-03-19
3
247
题解 | #统计作答次数#
第一次尝试select后面加子查询。。不知道可不可以,运行居然过了。。 select count(*), count(score), ( select count(distinct exam_id) from ...
2023-03-15
2
385
题解 | #SQL类别高难度试卷得分的截断平均值#
排除“一个”最大最小值,想到row_number窗口函数+子查询; 成功代码如下:(完全感觉做复杂了。。稍等看下大家怎么写的) with x as( select tag,difficulty,score,row_number() over(order by score desc ) r from...
2023-03-15
1
335
题解 | #返回产品名称和每一项产品的总订单数#
select prod_name, ifnull (orders, 0) from Products a left join ( select prod_id, count(*) orders ...
2023-03-12
1
242
题解 | #统计复旦用户8月练题情况#
select a.device_id,university,ifnull(b.question_cnt,0),ifnull(b.right_question_cnt,0) from user_profile a left join ( select ...
2023-03-09
1
222
题解 | #计算用户8月每天的练题数量#
select day (date), count(question_id) as question_cnt from question_practice_detail where MONTH (date) = 8 group by day (date)
2023-02-27
1
211
题解 | #统计每个学校的答过题的用户的平均答题数#
select u1.university, round(avg(p1.tt),4) from ( select device_id, count(question_id) as tt from ...
2023-02-27
1
213
首页
上一页
1
2
下一页
末页