排名

用户解题统计

过去一年提交了

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

收藏

收藏日期 题目名称 解决状态
2025-06-16 德州扑克起手牌-最强起手牌KK+  未解决
2025-06-15 条件过滤(3)Hour函数很给力,组合条件要仔细  已解决
2025-06-15 条件过滤-符合条件的班主任  已解决

评论笔记

评论日期 题目名称 评论内容 站长评论
2025-06-16 分组与聚合函数(6)想知道渣男有多坏,疯狂使用GroupBy 
select 
        usr_id,
        mch_nm,
        sum(trx_amt) as trx_amt,
        count(trx_amt) as trx_cnt,
        min(trx_time) as first_time
from 
        cmb_usr_trx_rcd
where
       usr_id='5201314520'
       and
       trx_amt >= 288
      group by mch_nm
      order by trx_cnt desc

为什么答案还有group by usr_id
select
    mch_nm
    ,sum(trx_amt) as trx_amt
    ,count(1) as trx_cnt
    ,min(trx_time) as first_time
from 
    cmb_usr_trx_rcd
where 
    usr_id='5201314520'
    and trx_amt>=288
group by mch_nm
order by 3 desc 

1、感受多列分组与单列分组,仔细对比这段代码跟你的代码的区别,数字是一样的;
2、以后你取数了,业务方让你取特定商户、特定分类的聚合数据,也可以加上,这样比较【踏实】(虽然第一列是重复的)
2025-06-16 找出三个班级的女生 
select 
        * 
from 
        students
where
        gender='f'
        and
        (class_code= 'C219' or  class_code= 'C220' or  class_code= 'C221')
        order by student_id
啥也没说
2025-06-16 国庆假期后第一天涨幅高于1%的股票 
select 
      *    
from 
      daily_stock_prices
where
     trade_date = '2023-10-09'
     and pct_change > 1

为什么这样是错的?
输出示例里只取了3个字段,你取了全部*呀
2025-06-15 条件过滤(2)半夜活动有猫腻,Hour函数给给力 
select 
          * 
from 
         cmb_usr_trx_rcd 
where 
           usr_id='5201314520'
           and
           date(trx_time) between '2024-09-01' and '2024-09-30'
           and time(trx_time)>= '01:00:00'
           and time(trx_time)< '06:00:00'
啥也没说
2025-06-15 条件过滤(2)半夜活动有猫腻,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) in (1,2,3,4,5)

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) between 1 and 5

表达的意思都一样吗
一模一样
2025-06-15 条件过滤(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) in (22, 23, 0, 1, 2, 3, 4, 5) 
    order by trx_time
啥也没说
2025-06-15 找出所有一元一次函数 
b<>0 这里什么意思呢
不等于,有两种写法,<> 、!=
2025-06-15 交易金额大于10000元的所有交易 
题目不是大于吗,为什么答案是>=
以你的为准,我修改下。
2025-06-15 大于J小于K的手牌 
答案没有  order by id。但是我是用了也没出错。我习惯性看到按id升序排序的时候会使用可以吗?
我修改过比对答案逻辑,以后都不用order by 了,(1,2,3,4) (3,4,1,2)在本站没区别了
2025-06-14 找出所有港台歌手 
11
啥也没说

提交记录

提交日期 题目名称 提交代码
2025-06-16 分组与聚合函数(6)想知道渣男有多坏,疯狂使用GroupBy 
select 
usr_id,
mch_nm,
sum(trx_amt) as trx_amt,
count(trx_amt) as trx_cnt,
min(trx_time) as first_time
from 
cmb_usr_trx_rcd
where
 usr_id='5201314520'
 and
 trx_amt >= 288
group by mch_nm
order by trx_cnt desc
2025-06-16 分组与聚合函数(1)Money全都花在哪,GroupBy来查一查 
select 
 mch_nm,
 sum(trx_amt) as sum_trx_amt
from 
cmb_usr_trx_rcd
where 
usr_id='5201314520'
and
trx_time between '2024-01-01' and '2024-12-31'
group by mch_nm
order by sum_trx_amt
2025-06-16 分组与聚合函数(1)Money全都花在哪,GroupBy来查一查 
select 
 mch_nm,
 sum(trx_amt) as sum_trx_amt
from 
cmb_usr_trx_rcd
where 
usr_id='5201314520'
and
year(trx_time)= 2024
group by mch_nm
order by sum_trx_amt
2025-06-16 不经过第二象限的所有函数 
select 
* 
from 
 numbers_for_fun
where
(a<0 and b*b-4*a*c<=0)
 or
 (a=0 and b>=0 and c<=0)
2025-06-16 与X轴有且只有一个交点的一元二次函数 
select 
* 
from 
numbers_for_fun
where
a!= 0
and
b*b-4*a*c=0
order by id
2025-06-16 开口向上且经过原点的一元二次函数 
select
* 
from 
 numbers_for_fun
where
 a>0
 and
a*0+b*0+c=0
order by id
2025-06-16 开口向上且经过原点的一元二次函数 
select
* 
from 
 numbers_for_fun
where
 a>0
 and
 b<>0
 and
 c=0
 order by id
2025-06-16 必过(3, -8)的一元一次函数 
select 
 * 
from 
 numbers_for_fun
where
a=0
and
(3*b+1*c)= -8
and
b<>0
order by id asc
2025-06-16 不经过第三象限的一元一次函数 
select 
* 
from 
 numbers_for_fun
where
 a=0
 and
 b<0
 and
 c>=0
 order by id
2025-06-16 不经过第三象限的一元一次函数 
select 
* 
from 
 numbers_for_fun
where
 a=0
 and
 b<0
 and
 c>0
 order by id
2025-06-16 特定渠道的中档单价用户 
select 
* 
from 
apple_pchs_rcd
where 
 order_channel= '官网'
 and
 payment_method= 'Apple Pay'
 and
 product_price >= 3000
 order by order_id
2025-06-16 文科潜力股 
select 
 * 
from 
 scores
where
 exam_date='2024-06-30'
 and
((subject='历史' and score >= 90)
 or(subject='政治' and score >= 90)
 or (subject='地理' and score >= 90))
 order by score desc ,student_id,subject
2025-06-16 文科潜力股 
select 
 * 
from 
 scores
where
 exam_date='2024-06-30'
 and
((subject='历史' and score >= 90)
 or(subject='地理' and score >= 90)
 or (subject='历史' and score >= 90))
 order by score desc ,student_id,subject
2025-06-16 文科潜力股 
select 
 * 
from 
 scores
where
 exam_date='2024-06-30'
 and
((subject='历史' and score >=90)
 or(subject='地理' and score >=90)
 or (subject='历史' and score >=90))
 order by score desc ,student_id,subject
2025-06-16 文科潜力股 
select 
 * 
from 
 scores
where
 exam_date='2024-06-30'
 and
((subject='历史' and score >=90)
 or
 (subject='地理' and score >=90)
 or 
 (subject='历史' and score >=90))
 order by score desc ,student_id,subject
2025-06-16 给英语成绩中上水平的学生拔尖 
select 
* 
from 
scores
where
 score is not null
 and
 exam_date = '2024-06-30'
 and
 subject = '英语'
 and
 score between 100 and 110
 order by score desc
2025-06-16 找出三个班级的女生 
select 
* 
from 
students
where
gender='f'
and
(class_code= 'C219' orclass_code= 'C220' orclass_code= 'C221')
order by student_id
2025-06-16 找出三个班级的女生 
select 
* 
from 
students
where
gender='f'
and
class_code= 'C219' orclass_code= 'C220' orclass_code= 'C221'
order by student_id
2025-06-16 大于J小于K的手牌 
select 
* 
from 
hand_permutations
where
card1 > 'J' and card1 < 'K'
and
card2 > 'J' and card2 < 'K'
order by id asc
2025-06-16 2000年以前出生的男歌手 
select 
* 
from 
 singer_info
where
birth_date < '2000-01-01' 
and gender = 'm'