排名

用户解题统计

过去一年提交了

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

收藏

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

评论笔记

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

提交记录

提交日期 题目名称 提交代码
2026-04-28 每日新增用户 
with newp as (select usr_id,min(date(login_time)) as dd
from user_login_log
where year(login_time)=2024 and month(login_time)=9
group by usr_id)
select dd,count(distinct usr_id)
from newp
group by dd
order by 1
2026-04-28 每日新增用户 
with newp as (select usr_id,min(date(login_time)) as dd
from user_login_log
where year(login_time)=2024 and month(login_time)=9
group by usr_id
order by min(date(login_time)))
select dd,count(distinct usr_id)
from newp
group by dd
2026-04-28 北交所每年上市数量 
select year(list_date) as Y,count(distinct symbol) as cnt
from stock_info
where ts_code like '%BJ' and list_date<='2024-11-07'
group by year(list_date)
2026-04-28 每年地产与软件服务上市公司对比 
select year(list_date) as Y,
sum(case when industry like '%地产' then 1 else 0 end) as 地产,
sum(case when industry like '%软件服务%' then 1 else 0 end) as 软件服务 
from stock_info
where year(list_date) between 2000 and 2024
group by year(list_date)
2026-04-28 深圳气温异常年份 
with basic as (select year(dt) as Y,cast(avg(tmp_h) as decimal(4,2)) as t 
from weather_rcd_china
where city='shenzhen' and year(dt) between 2011 and 2022
group by year(dt)),
twobasic as (select Y,t,lag(t,1) over(order by Y) as prey
from basic)
select Y as year ,t as avg_tmp_h,case when abs(t-prey)>1 then 'yes' else 'no' endas significant_change
from twobasic
2026-04-28 深圳气温异常年份 
with basic as (select year(dt) as Y,cast(avg(tmp_h) as decimal(4,2)) as t 
from weather_rcd_china
where city='shenzhen'
group by year(dt)),
twobasic as (select Y,t,lag(t,1) over(order by Y) as prey
from basic)
select Y as year ,t as avg_tmp_h,case when abs(t-prey)>1 then 'yes' else 'no' endas significant_change
from twobasic
2026-04-28 一线城市历年平均气温 
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-04-28 冬季下雪天数 
select city,sum(case when con like "%雪%" then 1 else 0 end) as snow_days
from weather_rcd_china
where 
    month(dt) in (12,1,2)
group by 
    city
order by
    2
desc
2026-04-27 冬季下雪天数 
select city,sum(case when wnd like "%雪%" then 1 else 0 end) as snow_days
from weather_rcd_china
where 
    month(dt) in (12,1,2)
group by 
    city
order by
    2
desc
2026-04-24 多云天气天数 
select city,sum(case when con like '%多云%' then 1 else 0 end) as cloudy_days,
CONCAT(
ROUND(
(SUM(CASE WHEN con LIKE '%多云%' THEN 1 ELSE 0 END) / COUNT(1)) * 100,
2
),
'%'
) as p
from weather_rcd_china
where year(dt) = 2021
group by city
order by p desc
2026-04-24 多云天气天数 
select city,sum(case when con like '%多云%' then 1 else 0 end) as cloudy_days,
round(sum(case when con like '%多云%' then 1 else 0 end)/count(1),2) as p
from weather_rcd_china
where year(dt) = 2021
group by city
order by p desc
2026-04-24 城市平均最高气温 
select city,cast(avg(tmp_h) as decimal(4,2))  as avg_tmp_h
from weather_rcd_china
where year(dt)=2021
group by city
order by avg_tmp_h desc
2026-04-24 城市平均最高气温 
select city,round(avg(tmp_l),2)
from weather_rcd_china
where year(dt)=2021
group by city
2026-04-24 城市平均最高气温 
select city,avg(tmp_l)
from weather_rcd_china
where year(dt)=2021
group by city
2026-04-24 用户"kjhd30"的第一笔未完成订单 
select *
from didi_order_rcd
where cust_uid = 'kjhd30' and finish_time = '1970-01-01 00:00:00'
order by order_id asc
limit 1
2026-04-24 滴滴面试真题(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-04-24 滴滴面试真题(2)打车订单呼叫应答时间 
select sum(TIMESTAMPDIFF(SECOND, call_time, grab_time))/count(1) AS avg_response_time_seconds
from didi_order_rcd
where cancel_time != "1970-01-01 00:00:00"
2026-04-22 不分类别的最火直播间 
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;
2026-04-22 绘制小时进入人数曲线 
select date_format(enter_time,'%h') as hour_entered,count(distinct usr_id) as enter_count
from ks_live_t1
group by hour_entered
order by hour_entered asc
2026-04-22 绘制小时进入人数曲线 
select date_format(enter_time,'%h') as hour_entered,count(usr_id) as enter_count
from ks_live_t1
group by hour_entered
order by hour_entered asc