排名

用户解题统计

过去一年提交了

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

收藏

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

评论笔记

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

提交记录

提交日期 题目名称 提交代码
2026-01-13 字符串与通配符(1)名称里面有特服,可以使用通配符 
select count(distinct mch_nm) mch_cnt from cmb_usr_trx_rcd where mch_nm like '%按摩保健休闲%';
2026-01-13 字符串与通配符(1)名称里面有特服,可以使用通配符 
select distinct count(*) from cmb_usr_trx_rcd where mch_nm like '%按摩保健休闲%';
2026-01-08 用户听歌习惯的时间分布 
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;
2026-01-08 用户听歌习惯的时间分布 
select * from singer_info limit 5;
2026-01-08 渣男腰子可真行,端午中秋干不停 
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'))
2026-01-08 渣男腰子可真行,端午中秋干不停 
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')
2026-01-08 上月活跃用户数 
select count(distinct usr_id) active_user 
from user_login_log where login_time >= date_format(date_sub(curdate(),interval 1 month),'%Y-%m-01 00:00:00') and login_time < date_format(curdate(), '%Y-%m-01 00:00:00')
2026-01-08 一线城市历年平均气温 
select year(dt) as Y ,
cast(avg(case when city <=> 'beijing' then substr(tmp_h,1,2) else null end) as decimal(4,2)) as '北京',
cast(avg(case when city <=> 'shanghai' then substr(tmp_h,1,2) else null end) as decimal(4,2)) as 上海, 
cast(avg(case when city <=> 'shenzhen' then substr(tmp_h,1,2) else null end) as decimal(4,2)) as 深圳,
cast(avg(case when city <=> 'guangzhou' then substr(tmp_h,1,2) else null end) as decimal(4,2)) as 广州
from weather_rcd_china where year(dt) 
between 2011 and 2022 group by year(dt)
2026-01-08 一线城市历年平均气温 
select year(dt) as Y ,
cast(avg(case when city <=> 'beijing' then substr(tmp_h,1,2) end) as decimal(4,2)) as '北京',
cast(avg(case when city <=> 'shanghai' then substr(tmp_h,1,2) end) as decimal(4,2)) as 上海, 
cast(avg(case when city <=> 'shenzhen' then substr(tmp_h,1,2) end) as decimal(4,2)) as 深圳,
cast(avg(case when city <=> 'guangzhou' then substr(tmp_h,1,2) end) as decimal(4,2)) as 广州
from weather_rcd_china where year(dt) 
between 2011 and 2022 group by year(dt)
2026-01-08 一线城市历年平均气温 
select year(dt) as Y
    ,cast(avg(case when city='beijing' then tmp_h else null end) as decimal(4,2)) as '北京'
    ,cast(avg(case when city='shanghai' then tmp_h else null end) as decimal(4,2)) as 上海
    ,cast(avg(case when city='shenzhen' then tmp_h else null end) as decimal(4,2)) as 深圳
    ,cast(avg(case when city='guangzhou' then tmp_h else null end) as decimal(4,2)) as 广州
from
    weather_rcd_china
where 
    year(dt) between 2011 and 2022
group by 
    year(dt)
2026-01-08 一线城市历年平均气温 
select year(dt) Y ,
cast(avg(case when city <=> 'beijing' then substr(tmp_h,1,2) end) as decimal(4,2)) as '北京',
cast(avg(case when city <=> 'shanghai' then substr(tmp_h,1,2) end) as decimal(4,2)) as 上海, 
cast(avg(case when city <=> 'shenzhen' then substr(tmp_h,1,2) end) as decimal(4,2)) as 深圳,
cast(avg(case when city <=> 'guangzhou' then substr(tmp_h,1,2) end) as decimal(4,2)) as 广州
from weather_rcd_china where year(dt) 
between 2011 and 2022 group by year(dt)
2026-01-08 一线城市历年平均气温 
select year(dt) V ,
cast(avg(case when city <=> 'beijing' then substr(tmp_h,1,2) end) as decimal(4,2)) as '北京',
cast(avg(case when city <=> 'shanghai' then substr(tmp_h,1,2) end) as decimal(4,2)) as 上海, 
cast(avg(case when city <=> 'shenzhen' then substr(tmp_h,1,2) end) as decimal(4,2)) as 深圳,
cast(avg(case when city <=> 'guangzhou' then substr(tmp_h,1,2) end) as decimal(4,2)) as 广州
from weather_rcd_china where year(dt) 
between 2011 and 2022 group by year(dt)
2026-01-08 一线城市历年平均气温 
select year(dt) V ,
cast(avg(case when city <=> 'beijing' then substr(tmp_h,1,2) end) as decimal(4,2)) as '北京',
cast(avg(case when city <=> 'shanghai' then substr(tmp_h,1,2) end) as decimal(4,2)) as '上海', 
cast(avg(case when city <=> 'shenzhen' then substr(tmp_h,1,2) end) as decimal(4,2)) as '深圳',
cast(avg(case when city <=> 'guangzhou' then substr(tmp_h,1,2) end) as decimal(4,2)) as '广州'
from weather_rcd_china where year(dt) 
between 2011 and 2022 group by year(dt)
2026-01-08 一线城市历年平均气温 
select year(dt) V ,avg(substr(tmp_h,1,2) && city <=> 'beijing') '北京',
avg(substr(tmp_h,1,2) && city <=> 'shanghai') '上海',
avg(substr(tmp_h,1,2) && city <=> 'shenzhen') '深圳',
avg(substr(tmp_h,1,2) && city <=> 'guangzhou') '广州'
from weather_rcd_china where year(dt) 
between '2011' and '2022' group by year(dt)
2026-01-08 冬季下雪天数 
select city,sum(con like '%雪%') 'snowy_days' from weather_rcd_china where month(dt) in (12,1,2) group by city;
2026-01-08 滴滴面试真题(2)打车订单呼叫应答时间 
SELECT 
    sum(TIMESTAMPDIFF(SECOND, call_time, grab_time))/count(1) AS avg_response_time_seconds
FROM 
    didi_order_rcd
WHERE 
    grab_time != '1970-01-01 00:00:00';
2026-01-08 条件过滤(3)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) >= 22 or (hour(trx_time) between 0 and 5)) order by trx_time
2026-01-08 条件过滤(3)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) >= 22) or (hour(trx_time) between 0 and 5) order by trx_time
2026-01-08 条件过滤(3)Hour函数很给力,组合条件要仔细 
select * from cmb_usr_trx_rcd where usr_id <=> '5201314520' and date(trx_time) between '2024-09-01'
and '2024-09-30' andhour(trx_time) >= 22 or (hour(trx_time) between 0 and 5) order by trx_time
2026-01-08 条件过滤(3)Hour函数很给力,组合条件要仔细 
select * from cmb_usr_trx_rcd where usr_id <=> '5201314520' and date(trx_time) between '2024-09-01'
and '2024-09-30' andhour(trx_time) >= 22 or hour(trx_time) between 0 and 5 order by trx_time