排名

用户解题统计

过去一年提交了

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

收藏

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

评论笔记

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

提交记录

提交日期 题目名称 提交代码
2025-11-28 按歌手名字字符长度统计歌手个数 
select
	length(singer_name),
count(singer_name)
from 
	singer_info
group by
	length(singer_name)
2025-11-28 统计字符长度 
select
	singer_name,
char_length(singer_name) as len
from 
	singer_info
2025-11-27 歌手名字大写 
select 
	distinct upper(singer_name) as uppered_name
from 
	singer_info
2025-11-26 北京有雪的日子 
select 
	dt,
tmp_h,
tmp_l,
con
from 
	weather_rcd_china
where
	city = 'beijing'
and
	con like '%雪%'
2025-11-25 人数最多的学生姓氏 
select 
	left(name,1) as surname,
count(name) as cnt
from
	students 
group by
	surname
order by
	cnt desc
limit 5
2025-11-24 多云天气天数 
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
	cloudy_days desc
2025-11-24 德州扑克起手牌- 手对 
select
	* 
from 
	hand_permutations 
where
	left(card1,1) = left(card2,1)
2025-11-24 德州扑克起手牌- A花 
select
	* 
from
	hand_permutations
where
	right(card1,1) = right(card2,1)
and
	(left(card1,1) = 'A' or left(card2,1) = 'A')
order by
	id asc
2025-11-24 德州扑克起手牌- A花 
select
	* 
from
	hand_permutations
where
	right(card1,1) = right(card2,1)
and
	(card1 like 'A%' or card2 like 'A%')
order by
	id asc
2025-11-24 德州扑克起手牌- A花 
select
	* 
from
	hand_permutations
where
	right(card1,1) = right(card2,1)
and
	card1 like 'A%' or card2 like 'A%'
order by
	id asc
2025-11-24 德州扑克起手牌- A花 
select
	* 
from
	hand_permutations
where
	right(card1,1) = right(card2,1)
and
	left(card1,1) = 'A' or left(card2,1) = 'A'
order by
	id asc
2025-11-24 德州扑克起手牌- A花 
select
	* 
from
	hand_permutations
where
	right(card1,1) = right(card2,1)
and
	left(card1,1) = 'A' or left(card2,1) = 'A'
2025-11-24 德州扑克起手牌- A花 
select
	* 
from
	hand_permutations
where
	right(card1,1) = right(card2,1)
and
	left(card1,1) = 'A'
2025-11-21 德州扑克起手牌-最强起手牌KK+ 
select
	* 
from 
	hand_permutations
where
	left(card1,1) in ('A','K')
and
	left(card2,1) in ('A','K')
2025-11-21 字符串与通配符(2)好多关键词做规则,可以使用rlike 
select
	case when mch_nm like '%按摩保健休闲%' then '按摩保健休闲'when lower(mch_nm) rlike '.*(按摩|保健|休闲|spa|养生|会所).*' then '按摩、保健、休闲、养生、SPA、会所' end as reg_rules,
	count(distinct mch_nm) as mch_cnt
from
	cmb_usr_trx_rcd
where mch_nm like '%按摩保健休闲%'
   or lower(mch_nm) rlike '.*(按摩|保健|休闲|spa|养生|会所).*'
group by
	reg_rules
order by
	mch_cnt
2025-11-21 字符串与通配符(1)名称里面有特服,可以使用通配符 
select 
	count(distinct mch_nm) as mch_cnt
from 
	cmb_usr_trx_rcd
where
	mch_nm like '%按摩保健休闲%'
2025-11-19 字符串与通配符(1)名称里面有特服,可以使用通配符 
select 
	count(distinct usr_id) as mch_cnt
from 
	cmb_usr_trx_rcd
where
	mch_nm like '%按摩保健休闲%'
2025-11-19 用户听歌习惯的时间分布 
select
	user_id,
dayname(start_time) as day_of_week,
count(user_id) as listens_per_day
from 
	listen_rcd
group by
	user_id,day_of_week
order by
	user_id,day_of_week
2025-11-19 渣男腰子可真行,端午中秋干不停 
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-11-19 渣男腰子可真行,端午中秋干不停 
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'