排名

用户解题统计

过去一年提交了

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

收藏

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

评论笔记

评论日期 题目名称 评论内容 站长评论
2025-03-29 条件过滤(2)半夜活动有猫腻,Hour函数给给力 
请问一定要用hour函数吗?为什么不能直接使用datetime函数把日期和时间都限定进去
啥也没说

提交记录

提交日期 题目名称 提交代码
2025-04-15 分组与聚合函数(5)五花八门的项目,其实都有固定套路(2) 
select trx_amt,
 count(1) AS total_trx_cnt,
 count(distinct usr_id) as unique_usr_cnt,
 count(1) / count(distinct usr_id) AS avg_trx_per_user 
from 
cmb_usr_trx_rcd 
where mch_nm = '红玫瑰按摩保健休闲'
and
(
(year(trx_time) = 2023 and month(trx_time) between 1 and 12)
or (year(trx_time) = 2024 and month(trx_time) between 1 and 6)
)
group by 
trx_amt
order by
    avg_trx_per_user desc 
limit 5
2025-04-15 分组与聚合函数(5)五花八门的项目,其实都有固定套路(2) 
select trx_amt,
 count(1) AS total_trx_cnt,
 count(distinct usr_id) as unique_usr_cnt,
 count(1) / count(distinct usr_id) AS avg_trx_per_user 
from cmb_usr_trx_rcd 
where mch_nm = '红玫瑰按摩保健休闲'
and
(
(year(trx_time) = 2023 and month(trx_time) between 1 and 12)
or (year(trx_time) = 2024 and month(trx_time) between 1 and 6)
)
group by trx_amt
2025-04-15 分组与聚合函数(3)五花八门的项目,其实都有固定套路(1) 
select trx_amt,
 count(1) AS trx_cnt
from cmb_usr_trx_rcd 
where mch_nm = '红玫瑰按摩保健休闲'
and year(trx_time) = 2024
and month(trx_time) between 1 and 7
group by 
trx_amt
order by
trx_cnt desc
limit 5
2025-04-15 分组与聚合函数(3)五花八门的项目,其实都有固定套路(1) 
select trx_amt,
 count(1) AS trx_cnt
from cmb_usr_trx_rcd 
where year(trx_time) = 2024
and month(trx_time) between 1 and 7
group by 
trx_amt
order by
trx_cnt desc
limit 5
2025-04-15 分组与聚合函数(2)擦边营收怎么样,聚合函数可看出 
select date(trx_time) as trx_date,
 max(trx_amt) as max_trx_amt,
 min(trx_amt) as min_trx_amt,
 avg(trx_amt) as avg_trx_amt,
 sum(trx_amt) as total_trx_amt
from cmb_usr_trx_rcd 
where mch_nm = '红玫瑰按摩保健休闲'
and date(trx_time)between '2024-09-01' and '2024-09-30'
group by trx_date
order by trx_date
2025-04-15 分组与聚合函数(2)擦边营收怎么样,聚合函数可看出 
select date(trx_time) as trx_date,
 max(trx_amt) as max_trx_amt,
 min(trx_amt) as min_trx_amt,
 avg(trx_amt) as avg_trx_amt,
 sum(trx_amt) as total_trx_amt
from cmb_usr_trx_rcd 
where mch_nm = '红玫瑰按摩保健休闲'
and date(trx_time)between '2024-09-01' and '2024-09-30'
group by date(trx_time)
order by trx_date
2025-04-15 输出特定日期上市的银行 
select * from stock_info 
where list_date between '2006-06-01'and '2006-09-01'
and industry = '银行'
2025-04-15 A和K之间的手牌(3) 
select * from hand_permutations 
where (card1 between 'A'and 'K') and(card2 between 'A'and 'K')
order by id
2025-04-15 A和K之间的手牌(2) 
select * from hand_permutations 
where card1 between 'A' and 'K' or card2 between 'A' and 'K' 
order by id
2025-04-15 A和K之间的手牌(1) 
select * from hand_permutations 
where card1 between 'A' and 'K'
order by id
2025-04-15 交易金额在5000至10000(含边界)的所有交易 
select * from cmb_usr_trx_rcd 
where trx_amt between 5000 and 10000
order by trx_amt desc
limit 5
2025-04-15 交易金额大于10000元的所有交易 
select * from cmb_usr_trx_rcd 
where trx_amt > 100000
order by trx_amt desc
2025-04-10 21世纪上市的银行 
select * from stock_info 
where industry = '银行' and year(list_date) > 1999
order by list_date
2025-04-10 大于J小于K的手牌 
select * from hand_permutations 
where card1 > 'J' and card1 < 'K'
and
 card2 > 'J' and card2 < 'K'
order by id
2025-04-10 语文数学英语至少1门超过100分的同学 
select * from subject_score 
where chinese > 100 or math > 100 or english > 100
order by chinese
2025-04-10 性别已知的听歌用户 
select * from qqmusic_user_info 
where (gender ='f'or gender='m')
and (year(birth_date)=1980)
order by birth_date
2025-04-10 2000年以前出生的男歌手 
select * from singer_info 
where year(birth_date) < 2000 and gender = 'm'
2025-04-10 输出地区为北京的所有银行 
select * from stock_info 
where area = '北京' and industry = '银行'
order by list_date
2025-04-10 1989年12月13日出生的女歌手 
select * from singer_info 
where gender = 'f' and birth_date ='1989-12-13'
2025-04-10 找出所有港台歌手 
select *from singer_info 
where type2 = '港台'
order by singer_id