排名

用户解题统计

过去一年提交了

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

收藏

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

评论笔记

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

提交记录

提交日期 题目名称 提交代码
2025-10-15 不分类别的最火直播间 
SELECT 
    t2.live_id,
    t2.live_nm,
    COUNT(*) AS enter_cnt
FROM 
    ks_live_t1 t1
JOIN 
    ks_live_t2 t2
ON 
    t1.live_id = t2.live_id
WHERE 
    DATE_FORMAT(t1.enter_time, '%Y-%m-%d %H') = '2021-09-12 23'
GROUP BY 
    t1.live_id, t2.live_nm
ORDER BY 
    enter_cnt DESC
LIMIT 5;
2025-10-02 S1年级物理成绩前10名(1) 
WITH ranked_scores AS (
    SELECT 
        s.student_id, 
        s.name, 
        sc.score,
        ROW_NUMBER() OVER (PARTITION BY s.grade_code ORDER BY sc.score DESC) AS rnk
    FROM 
        students s
    JOIN 
        scores sc ON s.student_id = sc.student_id
    WHERE 
        s.grade_code = 'S1' 
        AND sc.subject = '物理'
)
SELECT 
    student_id, 
    name, 
    score, 
    rnk
FROM 
    ranked_scores
WHERE 
    rnk <= 10
ORDER BY 
    rnk,student_id
2025-10-02 人数最多的学生姓氏 
select
	left(name, 1) as sur_name,
count(*) as cnt
from students
group by left(name, 1)
order by cnt desc
limit 5;
2025-10-02 人数最多的学生姓氏 
select * from students limit 5;
2025-05-04 学生信息和班主任姓名 
select
	s.name,
s.class_code,
s.grade_code,
t.name as head_teacher_name
from
	students s
join
	teachers t on s.class_code = t.head_teacher
order by
	s.student_id;
2025-05-03 GROUP BY-各班级人数 
select
	class_code,
count(student_id) as students_count
from
	students
group by
	class_code
order by
	students_count desc;
2025-05-03 按照车类统计行程次数 
select
	car_cls,
count(*) as trip_count
from
	didi_sht_rcd
group by
	car_cls
order by
	trip_count desc;
2025-05-03 多云天气天数 
select city,
	sum(case when con like '%多云%' then 1 else 0 end) as cloudy_days,
	concat(cast(sum(case when con like '%多云%' then 1 else 0 end)/count(1)*100 as decimal(10,2)),'%')  as p
from 
    weather_rcd_china
where 
    year(dt)=2021
group by 
    city
order by 
    3 desc
2025-05-02 分类(1)姿势太多很过分,分类要用CaseWhen 
select
case when trx_amt=288 then '1.WithHand'
when trx_amt=388 then '2.WithMimi'
when trx_amt=588 then '3.BlowJobbie'
when trx_amt=888 then '4.Doi'
when trx_amt=1288 then '5.DoubleFly'
else '6.other'
end as ser_typ,
count(1) as trx_cnt,
min(date(trx_time)) as first_date
from 
	cmb_usr_trx_rcd
where
	usr_id='5201314520'
and mch_nm='红玫瑰按摩保健休闲'
group by ser_typ
order by 1;
2025-05-02 分组与聚合函数(6)想知道渣男有多坏,疯狂使用GroupBy 
select
	usr_id,
mch_nm,
sum(trx_amt) as trx_amt,
count(1) as trx_cnt,
min(trx_time) as first_time
from
	cmb_usr_trx_rcd
where
	usr_id = '5201314520'
and	trx_amt >= 288
group by
	usr_id, mch_nm
order by
	trx_cnt desc;
2025-05-02 分组与聚合函数(1)Money全都花在哪,GroupBy来查一查 
select
	mch_nm,
sum(trx_amt) as sum_trx_amt
from
	cmb_usr_trx_rcd
where
	year(trx_time) = '2024'
and usr_id = '5201314520'
group by mch_nm
order by sum_trx_amt desc;
2025-05-02 与X轴有且只有一个交点的一元二次函数 
select * from numbers_for_fun
where
	b * b - 4 * a * c = 0 and a <> 0
order by id;
2025-05-02 开口向上且经过原点的一元二次函数 
select * from numbers_for_fun
where
	a > 0 and a * 0 + b * 0 + c = 0
order by id;
2025-05-02 开口向上且经过原点的一元二次函数 
select * from numbers_for_fun
where
	a > 0 and b <> 0 and c = 0
order by id;
2025-05-02 必过(3, -8)的一元一次函数 
select * from numbers_for_fun
where
	a = 0 and 3 * b + c = -8 and b <> 0
order by id;
2025-05-02 不经过第三象限的一元一次函数 
select * from numbers_for_fun
where
	a = 0 and b < 0 and c >= 0
order by id;
2025-05-02 特定渠道的中档单价用户 
select * from apple_pchs_rcd
where
	product_price >= 3000
and payment_method = 'Apple Pay'
and order_channel = '官网'
order by order_id;
2025-05-02 特定渠道的中档单价用户 
select * from apple_pchs_rcd
where
	product_price >= 3000
and payment_method = 'Apple Pay'
order by order_id;
2025-05-02 文科潜力股 
select * from scores
where
	score >= 90
and subject in ('历史', '政治', '地理')
and exam_date = '2024-06-30'
order by
	score desc,
student_id,
subject;
2025-05-02 给英语成绩中上水平的学生拔尖 
select * from scores
where
subject = '英语'
and score between 100 and 110
and exam_date = '2024-06-30'
order by score desc;