排名

用户解题统计

过去一年提交了

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

收藏

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

评论笔记

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

提交记录

提交日期 题目名称 提交代码
2025-08-19 每年在深交所上市的银行有多少家 
select year(list_date) as Y,
	count(distinct ts_code) as cnt
from stock_info where industry = '银行' and ts_code like '%SZ'
group by Y
order by Y asc
2025-08-19 每年在深交所上市的银行有多少家 
select year(list_date) as Y,
	count(*) as cnt
from stock_info where industry = '银行' and area = '深圳'
group by Y
order by Y asc
2025-08-19 每年在深交所上市的银行有多少家 
select year(list_date) as Y,
	sum(case area when '深圳' then 1 else 0 end) as cnt
from stock_info where industry = '银行'
group by Y
order by Y asc
2025-08-19 每年在深交所上市的银行有多少家 
select year(list_date) as Y,
	sum(case area when '深圳' then 1 else 0 end) as cnt
from stock_info
group by Y
order by Y asc
2025-08-19 冬季下雪天数 
select city,
	sum(case when con like '%雪%' then 1 else 0 end) as snowy_days
from weather_rcd_china
where substr(dt,6,2) in ('12','01','02') 
group by city
order by snowy_days desc
2025-08-19 多云天气天数 
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 p desc
2025-08-04 城市平均最高气温 
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
2025-08-04 城市平均最高气温 
select city, max((LEFT(tmp_h, LENGTH(tmp_h) - 1) + LEFT(tmp_l, LENGTH(tmp_l) - 1))/2) as avg_tmp_h
from weather_rcd_china
where year(dt) = '2021'
group by city
order by avg_tmp_h desc
2025-08-04 城市平均最高气温 
select city, max((LEFT(tmp_h, LENGTH(tmp_h) - 1) + LEFT(tmp_l, LENGTH(tmp_l) - 1))/2) as avg_tmp_h
from weather_rcd_china
where year(dt) = '2021'
group by city
2025-08-04 用户"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
2025-08-04 滴滴面试真题(2)打车订单呼叫应答时间 
select sum(timestampdiff(second, call_time, grab_time))/count(*) as avg_response_time_seconds from didi_order_rcd
where grab_time != '1970-01-01 00:00:00'
2025-08-04 滴滴面试真题(2)打车订单呼叫应答时间 
select sum(timestampdiff(second, call_time, grab_time))/count(*) as avg_response_time_seconds from didi_order_rcd
where grab_time != '1970-01-01 00:00:00' and cancel_time = '1970-01-01 00:00:00'
2025-08-04 滴滴面试真题(2)打车订单呼叫应答时间 
select sum(grab_time - call_time)/count(*) as avg_response_time_seconds from didi_order_rcd
where grab_time != '1970-01-01 00:00:00' and cancel_time = '1970-01-01 00:00:00'
2025-08-03 不分类别的最火直播间 
select t2.live_id, t2.live_nm,count(usr_id) as enter_cnt
from ks_live_t1 t1 inner 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 t2.live_id, t2.live_nm
order by enter_cnt desc limit 5
2025-08-01 绘制小时进入人数曲线 
select lpad(hour(enter_time),2,0) as hour_entered, count(*) as enter_count
from ks_live_t1
group by hour_entered
order by hour_entered asc
2025-08-01 德州扑克起手牌-最强起手牌KK+ 
select * from hand_permutations
where
	(left(card1,1) = 'A' and left(card2,1) = 'A') or
(left(card1,1) = 'K' and left(card2,1) = 'K') or
(left(card1,1) = 'A' and left(card2,1) = 'K') or 
(left(card1,1) = 'K' and left(card2,1) = 'A')
2025-08-01 德州扑克起手牌-最强起手牌KK+ 
select * from hand_permutations
where
	(left(card1,1) = 'A' and left(card2,1) = 'A') or
(left(card1,1) = 'K' and left(card2,1) = 'K') or
(left(card1,1) = 'A' and left(card2,1) = 'K')
2025-08-01 销售金额前10的商品信息 
select goods_id, sum(order_gmv) as total_gmv from order_info
where date(order_time) = '2024-09-10'
group by goods_id
order by total_gmv desc limit 10
2025-08-01 表连接(2)渣男去过我对象没去过,那就用LeftJoin 
select t1.mch_nm as asshole_tried, t1.trx_cnt, t2.mch_nm as darling_tried from 
(select mch_nm, count(*) as trx_cnt
from cmb_usr_trx_rcd
where usr_id = '5201314520' and year(trx_time) in (2023, 2024)
group by mch_nm
having trx_cnt >= 20) as t1
left join
(select distinct mch_nm
from cmb_usr_trx_rcd
where year(trx_time) in (2023,2024) and usr_id='5211314521') as t2
on t1.mch_nm = t2.mch_nm
order by t1.trx_cnt desc
2025-08-01 表连接(1)你们难道都去过?那就试试用InnerJoin 
select distinct t1.mch_nm
from cmb_usr_trx_rcd t1 inner join cmb_usr_trx_rcd t2
on t1.mch_nm = t2.mch_nm
where t1.usr_id = '5201314520' and year(t1.trx_time) = '2024' and t2.usr_id = '5211314521' and year(t2.trx_time) = '2024'
order by t1.mch_nm desc