排名

用户解题统计

过去一年提交了

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

收藏

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

评论笔记

评论日期 题目名称 评论内容 站长评论
没有评论过的题目。

提交记录

提交日期 题目名称 提交代码
2025-07-04 一线城市历年平均气温 
select year(dt) as Y,
avg(case when city = 'beijing' then tmp_h else null end) as '北京',
avg(case when city = 'shanghai' then tmp_h else null end) as '上海',
avg(case when city = 'guangzhou' then tmp_h else null end) as '广州',
avg(case when city = 'shenzhen' then tmp_h else null end) as '深圳'
from weather_rcd_china
where year(dt) between 2011 and 2022
group by year(dt)
2025-07-03 查询播放量为0的歌手及其专辑 
select si.singer_id, si.singer_name, ai.album_id, ai.album_name, count(lr.id) as listen_cnt from singer_info si 
join album_info ai on si.singer_id = ai.singer_id
left join song_info sinfo on si.singer_id = sinfo.origin_singer_id
left join listen_rcd lr on sinfo.song_id = lr.song_id
group by si.singer_id, ai.album_id, sinfo.song_id, lr.song_id
having listen_cnt = 0
2025-07-03 查询播放量为0的歌手及其专辑 
select si.singer_name, ai.album_name, count(lr.id) as listen_cnt from singer_info si 
join album_info ai on si.singer_id = ai.singer_id
left join song_info sinfo on si.singer_id = sinfo.origin_singer_id
left join listen_rcd lr on sinfo.song_id = lr.song_id
group by si.singer_id, ai.album_id, sinfo.song_id, lr.song_id
having listen_cnt = 0
2025-07-03 用户听歌习惯的时间分布 
select user_id, dayname(start_time) as day_of_week, count(*) as listen_per_day from listen_rcd
 group by user_id, day_of_week
 order by user_id, day_of_week asc
2025-07-03 曝光量最大的商品 
select tpar.prd_id, tpm.prd_nm, count(tpar.cust_uid) as cnt_cu from tb_pg_act_rcd tpar left join tb_prd_map tpm on tpar.prd_id = tpm.prd_id
where tpar.if_snd = 1
group by tpar.prd_id, tpm.prd_nm
order by cnt_cu desc 
limit 1;
2025-07-03 曝光量最大的商品 
select tpar.prd_id, tpm.prd_nm, count(tpar.cust_uid) as cnt_cu from tb_pg_act_rcd tpar left join tb_prd_map tpm on tpar.prd_id = tpm.prd_id
where tpar.if_snd = 1
group by tpar.prd_id, tpm.prd_nm
order by cnt_cu desc
2025-07-03 查询所有终点是餐饮类地点的行程记录 
select dsr.cust_uid, dsr.start_loc, dsr.end_loc, dsr.start_tm, dsr.car_cls from didi_sht_rcd dsr left join loc_nm_ctg lnc on dsr.end_loc = lnc.loc_nm
where loc_ctg = '餐饮'
order by dsr.start_tm asc
2025-07-03 不分类别的最火直播间 
select t1.live_id, t2.live_nm, count(t1.enter_time) as enter_cnt from ks_live_t1 t1 left join ks_live_t2 t2 on t1.live_id = t2.live_id
 where date(t1.enter_time) = '2021-09-12'
 and hour(t1.enter_time) = 23
 group by t1.live_id, t2.live_nm
 order by enter_cnt desc
 limit 5;
2025-07-03 不分类别的最火直播间 
select t1.live_id, t2.live_nm, count(t1.enter_time) as enter_cnt from ks_live_t1 t1 left join ks_live_t2 t2 on t1.live_id = t2.live_id
 where date(t1.enter_time) = '2021-09-12'
 and hour(t1.enter_time) = 23
 group by t1.live_id, t2.live_nm
 order by enter_cnt desc
2025-07-01 文科潜力股 
select * from scores
where(
(subject = '历史' and score >= 90)
or (subject = '地理' and score >= 90)
or (subject = '政治' and score >= 90))
and date(exam_date) = '2024-06-30'
order by score desc, student_id, subject
2025-07-01 文科潜力股 
select * from scores
where(
(subject = '历史' and score >= 90)
or (subject = '地理' and score >= 90)
or (subject = '政治' and score >= 90))
and date(exam_date) = '2024-09-30'
order by score desc, student_id, subject
2025-06-30 给英语成绩中上水平的学生拔尖 
select * from scores
where exam_date = '2024-06-30'
and subject = '英语'
and score between 100 and 110
order by score desc
2025-06-30 找出三个班级的女生 
select * from students
where class_code in ('C219', 'C220', 'C221')
and gender = 'f'
order by student_id
2025-06-30 找出三个班级的女生 
select * from students
where class_code in ('C219', 'C220', 'C221')
and gender - 'f'
order by student_id
2025-06-30 语文数学英语至少1门超过100分的同学 
select * from subject_score
where(
chinese > 100
or math >100
or english > 100)
order by chinese
2025-06-30 小结-行转列,展开学生成绩(1) 
select exam_date,
max(case when subject = '语文' then score else null end)as chinese_score,
max(case when subject = '数学' then score else null end)as math_score,
max(case when subject = '英语' then score else null end)as english_score
from scores
where student_id = '460093' and subject in ('语文','数学','英语')
group by exam_date
order by exam_date
2025-06-30 HAVING-语数英优异的学生 
select sc.student_id, sum(sc.score) as total_score from students s left join scores sc on s.student_id = sc.student_id
where date(sc.exam_date) = '2024-06-30'
and sc.subject in ('语文', '数学', '英语')
group by sc.student_id
having sum(sc.score) > 330
order by sc.student_id asc
2025-06-30 HAVING-语数英优异的学生 
select s.name, sum(sc.score) as total_score from students s left join scores sc on s.student_id = sc.student_id
where date(sc.exam_date) = '2024-06-30'
and sc.subject in ('语文', '数学', '英语')
group by sc.student_id
having sum(sc.score) > 330
order by total_score desc
2025-06-30 HAVING-执教教师超过3人的科目 
select subject from teachers
group by subject
having count(subject) >= 3
2025-06-30 HAVING-每次成绩都不低于80分的学生 
select student_id, max(score) as max_score, min(score) as min_score, avg(score) as avg_score from scores
group by student_id
having min(score) >= 80
order by student_id