排名

用户解题统计

过去一年提交了

勋章 ①金银铜:在竞赛中获得第一二三名;②好习惯:自然月10天提交;③里程碑:解决1/2/5/10/20/50/100/200题;④每周打卡挑战:完成每周5题,每年1月1日清零。

收藏

收藏日期 题目名称 解决状态
没有收藏的题目。

评论笔记

评论日期 题目名称 评论内容 站长评论
2026-01-12 给英语成绩中上水平的学生拔尖 
between 写错了
啥也没说

提交记录

提交日期 题目名称 提交代码
2026-02-28 用户听歌习惯的时间分布 
select 
user_id,
dayname(start_time) day_of_week,
count(1) listens_per_day
from listen_rcd
group by user_id,day_of_week
order by 1,2
2026-02-28 用户听歌习惯的时间分布 
select 
user_id,
dayname(start_time) day_of_week,
count(1) listens_per_day
from listen_rcd
group by user_id,day_of_week
order by 1,2
limit 5;
2026-02-28 数学成绩分段统计(1) 
select 
case 
	WHEN score >= 110 THEN '[110, 120]'
        WHEN score >= 90 THEN '[90, 110)'
        WHEN score >= 60 THEN '[60, 90)'
        ELSE '[0, 60)'
end
score_range,
count(*) num_students
from scores
where exam_date = '2024-06-30' and subject = '数学'
group by score_range
order by 1 desc
2026-02-28 数学成绩分段统计(1) 
select 
case 
	when score >= 110 then '[110, 120]'
when score >= 90 then '[90, 110)'
when score >= 60 then '[60, 90)'
else '[0, 60)'
end
score_range,
count(*) num_students
from scores
where exam_date = '2024-06-30' and subject = '数学'
group by score_range
order by 1 desc
2026-02-28 数学成绩分段统计(1) 
select 
case 
	when score >= 110 then '[110,120]'
when score >= 90 then '[90,110)'
when score >= 60 then '[60,90)'
else '[0,60)'
end
score_range,
count(*) num_students
from scores
where exam_date = '2024-06-30' and subject = '数学'
group by score_range
order by 1 desc
2026-02-28 数学成绩分段统计(1) 
select 
case 
	when score >= 110 then '[110,120]'
when score >= 90 then '[90,110)'
when score >= 60 then '[60,90)'
else '[0,60)'
end
score_range,
count(*) num_students
from scores
where exam_date = '2024-06-30' and subject = '数学'
group by score_range
order by 1 desc
2026-02-28 数学成绩分段统计(1) 
select 
case 
	when score >= 110 then '[110,120]'
when score >= 90 then '[90,110)'
when score >= 60 then '[60,90)'
else '[0,60)'
end
score_range,
count(*) num_students
from scores
where exam_date = '2024-06-30' and subject = '数学'
group by score_range
order by 1
2026-02-28 数学成绩分段统计(1) 
with math_rank as (
select
	student_id
,case when
	score>=110 then '[110, 120]'
when 
	score between 90 and 109 then '[90, 110)'
when
	score between 60 and 89 then '[60, 90)'
		else '[0, 60)'
end as score_range
from
	scores
where	
	exam_date='2024-06-30'
and subject='数学')
select
	score_range
,count(*) as num_students
from
	math_rank
group by
	score_range
2026-02-28 数学成绩分段统计(1) 
select 
case 
	when score >= 110 then '[110,120]'
when score >= 90 then '[90,110)'
when score >= 60 then '[60,90)'
else '[0,60)'
end
score_range,
count(*) num_students
from scores
where exam_date = '2024-06-30' and subject = '数学'
group by score_range
order by 2
2026-02-28 数学成绩分段统计(1) 
select 
case 
	when score >= 110 then '[110,120]'
when score >= 90 then '[90,110)'
when score >= 60 then '[60,90)'
else '[0,60)'
end
score_range,
count(*) num_students
from scores
where exam_date = '2024-06-30' and subject = '数学'
group by score_range
order by 2 desc
2026-02-28 数学成绩分段统计(1) 
select 
case 
	when score >= 110 then '[110,120]'
when score >= 90 then '[90,110)'
when score >= 60 then '[60,90)'
else '[0,60)'
end
score_range,
count(*) num_students
from scores
where exam_date = '2024-06-30' and subject = '数学'
group by score_range
2026-02-28 数学成绩分段统计(1) 
select 
case 
	when score >= 110 then '[110,120]'
when score >= 90 then '[90,110)'
when score >= 60 then '[60,90)'
else '[0,60)'
end
score_range,
count(*) num_students
from scores
where exam_date = '2024-06-30'
group by score_range
2026-02-28 不分类别的最火直播间 
select
a.live_id live_id,a.live_nm live_nm,count(1) enter_cnt
from 
ks_live_t2 a
left join
ks_live_t1 b
on a.live_id = b.live_id
where date_format(b.enter_time,'%Y-%m-%d %H') = '2021-09-12 23'
group by live_id,live_nm
order by 3 desc
limit 5
2026-02-28 不分类别的最火直播间 
select
a.live_id live_id,a.live_nm live_nm,count(1) enter_cnt
from 
ks_live_t2 a
left join
ks_live_t1 b
on a.live_id = b.live_id
where date_format(b.enter_time,'%Y-%m-%d %H') = '2021-09-12 23'
group by live_id,live_nm
order by 3 desc
2026-02-28 不分类别的最火直播间 
select
a.live_id live_id,a.live_nm live_nm,count(1) enter_cnt
from 
ks_live_t2 a
left join
ks_live_t1 b
on a.live_id = b.live_id
where b.enter_time < '2021-9-12 23:00:00' and b.leave_time> '2021-9-12 23:00:00'
group by live_id,live_nm
order by 3 desc
2026-02-28 表连接(2)渣男去过我对象没去过,那就用LeftJoin 
select 
a.mch_nmasshole_tried,
a.trx_cnt trx_cnt,
b.mch_nmdarling_tried
from 
(select mch_nm,count(1) trx_cnt from cmb_usr_trx_rcd 
 where trx_time rlike '2023|2024' and usr_id = 5201314520
 group by mch_nm 
 having trx_cnt >= 20) a
 left join 
 (select distinct mch_nm from cmb_usr_trx_rcd 
where trx_time rlike '2023|2024' and usr_id = 5211314521) b
 on a.mch_nm = b.mch_nm
 order by 2 desc
2026-02-28 表连接(2)渣男去过我对象没去过,那就用LeftJoin 
select 
a.mch_nmasshole_tried,
a.trx_cnt trx_cnt,
b.mch_nmdarling_tried
from 
(select mch_nm,count(1) trx_cnt from cmb_usr_trx_rcd 
 where trx_time rlike '2023|2024' and usr_id = 5201314520
 group by mch_nm 
 having trx_cnt >= 20) a
 left join 
 (select distinct mch_nm from cmb_usr_trx_rcd 
where year(trx_time) in (2023,2024) and usr_id = 5211314521) b
 on a.mch_nm = b.mch_nm
 order by 2 desc
2026-02-28 表连接(2)渣男去过我对象没去过,那就用LeftJoin 
select 
a.mch_nmasshole_tried,
a.trx_cnt trx_cnt,
b.mch_nmdarling_tried
from 
(select mch_nm,count(1) trx_cnt from cmb_usr_trx_rcd 
 where trx_time rlike '2023|2024' and usr_id = 5201314520
 group by mch_nm 
 having trx_cnt >= 20) a
 left join 
 (select distinct mch_nm from cmb_usr_trx_rcd 
where trx_time in (2023,2024) and usr_id = 5211314521) b
 on a.mch_nm = b.mch_nm
 order by 2 desc
2026-02-28 表连接(1)你们难道都去过?那就试试用InnerJoin 
select distinct a.* from 
(select mch_nm from cmb_usr_trx_rcd where usr_id = 5201314520 and left(trx_time,4)=2024) a
inner join
(select mch_nm from cmb_usr_trx_rcd where usr_id = 5211314521 and left(trx_time,4)=2024) b
on a.mch_nm = b.mch_nm
order by 1 desc
2026-02-28 表连接(1)你们难道都去过?那就试试用InnerJoin 
select distinct a.* from 
(select mch_nm from cmb_usr_trx_rcd where usr_id = 5201314520 and left(trx_time,4)) a
inner join
(select mch_nm from cmb_usr_trx_rcd where usr_id = 5211314521 and left(trx_time,4)) b
on a.mch_nm = b.mch_nm
order by 1 desc