排名

用户解题统计

过去一年提交了

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

收藏

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

评论笔记

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

提交记录

提交日期 题目名称 提交代码
2025-09-19 条件过滤-没有职称的老教师 
select * 
from teachers 
where qualification is null
2025-09-18 数学成绩分段统计(1) 
SELECT 
    CASE 
        WHEN sc.score >= 110 THEN '[110, 120]'
        WHEN sc.score >= 90 THEN '[90, 110)'
        WHEN sc.score >= 60 THEN '[60, 90)'
        ELSE '[0, 60)'
    END AS score_range,
    COUNT(*) AS num_students
FROM 
    students s
JOIN 
    scores sc ON s.student_id = sc.student_id
WHERE 
    sc.subject = '数学' 
    AND sc.exam_date = '2024-06-30'
GROUP BY 
    score_range
ORDER BY 
    score_range DESC;
2025-09-18 用户听歌习惯的时间分布 
SELECT 
    u.user_id,
    DAYNAME(lr.start_time) AS day_of_week,
    COUNT(*) AS listens_per_day
FROM 
    qqmusic_user_info u
JOIN 
    listen_rcd lr ON u.user_id = lr.user_id
GROUP BY 
    u.user_id, day_of_week
ORDER BY 
    u.user_id ASC, day_of_week ASC;
2025-09-18 渣男腰子可真行,端午中秋干不停 
select * 
from cmb_usr_trx_rcd 
where usr_id = '5201314520' and
(date(trx_time) between '2024-06-08' and '2024-06-10' or
date(trx_time) between '2024-09-15' and '2024-09-17')
2025-09-18 渣男腰子可真行,端午中秋干不停 
select * 
from cmb_usr_trx_rcd 
where usr_id = '5201314520' and
date(trx_time) between '2024-06-08' and '2024-06-10' or
date(trx_time) between '2024-09-15' and '2024-09-17'
2025-09-18 上月活跃用户数 
select * from user_login_log limit 5;
2025-09-18 冬季下雪天数 
select 
    city
    ,sum(case when con like '%雪%' then 1 else 0 end) as snowy_days
from 
    weather_rcd_china
where 
    month(dt) in (12,1,2)
group by 
    city
order by
    2
desc
2025-09-17 条件过滤(3)Hour函数很给力,组合条件要仔细 
select
    *
from
    cmb_usr_trx_rcd
where
    date(trx_time) 
    between '2024-09-01' and '2024-09-30' 
    and (
        (hour(trx_time) >= 22) 
        or
        (hour(trx_time) between 0 and 5) 
    )
    and usr_id = '5201314520' 
order by trx_time
2025-09-17 条件过滤(2)半夜活动有猫腻,Hour函数给给力 
select * 
from cmb_usr_trx_rcd 
where usr_id = '5201314520' and 
date(trx_time) between'2024-09-01' and '2024-09-30'and
hour(trx_time) between'01:00:00' and '05:00:00'
2025-09-17 条件过滤(1)异地男友有异常,数分闺蜜来帮忙 
select * 
from cmb_usr_trx_rcd
where usr_id = 5201314520 and date(trx_time) between '2024-09-01' and '2024-09-30'
2025-09-17 基于共同兴趣爱好的餐厅推荐(1)-我吃过啥 
select cust_uid,mch_nm
from mt_trx_rcd1
where cust_uid = 'MT10000'
group by mch_nm
2025-09-17 HAVING-语数英优异的学生 
select student_id,sum(score)
from scores
where exam_date = '2024-06-30' and subject in ('语文','数学','英语')
group by student_id
having sum(score) >330
2025-09-17 HAVING-语数英优异的学生 
select student_id,sum(score)
from scores
where exam_date = '2024-06-30'
group by student_id
having sum(score) >330
2025-09-17 HAVING-语数英优异的学生 
select student_id,sum(score)
from scores
where exam_date = '2024-06-30'
group by student_id
having sum(score) >=330
2025-09-16 HAVING-执教教师超过3人的科目 
SELECT subject
from teachers
group by subject
having count(subject) >=3
2025-09-16 HAVING-每次成绩都不低于80分的学生 
select student_id,max(score) max_score, min(score) min_score, avg(score) avg_score
from scores
group by student_id
having min(score)>=80
order by student_id
2025-09-16 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
2025-09-16 HAVING-每次成绩都不低于80分的学生 
select student_id,max(score) as max_score,min(score) as min_score,avg(score) as avg_score
from scores 
where score >80 or score is null
group by student_id
order by student_id desc
2025-09-16 HAVING-每次成绩都不低于80分的学生 
select student_id,max(score) as max_score,min(score) as min_score,avg(score) as avg_score
from scores 
where score >80 or score is null
group by student_id
order by student_id asc
2025-09-16 HAVING-每次成绩都不低于80分的学生 
select student_id,max(score) as max_score,min(score) as min_score,avg(score) as avg_score
from scores 
where score >80 or score is null
group by student_id