排名

用户解题统计

过去一年提交了

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

错题集 数据思维刷题中答错的题目

模块 知识点 题目 你的答案 正确答案 操作
暂无错题,继续保持!

收藏

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

评论笔记

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

提交记录

提交日期 题目名称 提交代码
2026-07-04 查询所有起点或终点为“海底捞西丽店”的行程记录 
select * from didi_sht_rcd
where start_loc = '海底捞西丽店' 
or end_loc='海底捞西丽店'
2026-07-04 登录天数分布 
with days as (
select usr_id, count(distinct date(login_time)) login_days
from user_login_log
where login_time>= date_sub(current_date, interval 180 day)
group by usr_id)
select 
sum(case whenlogin_days between 1 and 5 then 1 else 0 end )as '1-5',
sum(case whenlogin_days between 6 and 10 then 1 else 0 end) as '5-10',
sum(case whenlogin_days between 11 and 20 then 1 else 0 end) as '10-20',
sum(case whenlogin_days >20 then 1 else 0 end) as'20天以上'
from days
2026-07-04 登录天数分布 
with days as (
select distinct usr_id, login_time login_days
from user_login_log
where login_time>= date_sub(current_date, interval 180 day))
select 
sum(case whenlogin_days between 1 and 5 then 1 else 0 end )as '1-5',
sum(case whenlogin_days between 6 and 10 then 1 else 0 end ) '5-10',
sum(case whenlogin_days between 11 and 20 then 1 else 0 end ) '10-20',
sum(case whenlogin_days >20 then 1 else 0 end ) '20天以上'
from days
2026-07-04 通勤、午休、临睡个时间段活跃人数分布 
select 
count(distinct case when time(login_time) between '07:30:00' and '09:30:00'
or time(login_time) between '18:30:00' and '20:30:00'
 then usr_id
 else null
 end) as commute,
count(distinct case when time(login_time) between '11:30:00' and '14:00:00' then usr_id
 else null end) as lunch,
 count(distinct case when time(login_time) between '22:30:00' and '23:59:59'
 or time(login_time) between '00:00:00' and '01:00:00'
 then usr_id
 else null end) as sleep
from user_login_log 
where login_time>=date_format(date_sub(current_date, interval 1 month), '%Y-%m-01 00:00:00')
and login_time<date_format(current_date, '%Y-%m-01 00:00:00')
2026-07-04 通勤、午休、临睡个时间段活跃人数分布 
select 
sum(case when time(login_time) between '07:30:00' and '09:30:00'
or time(login_time) between '18:30:00' and '20:30:00'
 then 1
 else 0
 end) as commute,
sum(case when time(login_time) between '11:30:00' and '14:00:00' then 1
 else 0 end) as lunch,
 sum(case when time(login_time) between '22:30:00' and '23:59:59'
 or time(login_time) between '00:00:00' and '01:00:00'
 then 1
 else 0 end) as sleep
from user_login_log 
where login_time>=date_format(date_sub(current_date, interval 1 month), '%Y-%m-01 00:00:00')
and login_time<date_format(current_date, '%Y-%m-01 00:00:00')
2026-07-04 通勤、午休、临睡个时间段活跃人数分布 
select 
sum(case when time(login_time) between '07:30:00' and '09:30:00'
or time(login_time) between '18:30:00' and '20:30:00'
 then 1
 else 0
 end) as commute,
sum(case when time(login_time) between '11:30:00' and '14:00:00' then 1
 else 0 end) as lunch,
 sum(case when time(login_time) between '23:30:00' and '23:59:59'
 or time(login_time) between '00:00:00' and '01:00:00'
 then 1
 else 0 end) as sleep
from user_login_log 
where login_time>=date_format(date_sub(current_date, interval 1 month), '%Y-%m-01 00:00:00')
and login_time<date_format(current_date, '%Y-%m-01 00:00:00')
2026-07-04 上月活跃用户数 
select 
count(distinct usr_id) 
from user_login_log 
 where login_time >= date_format(date_sub(current_date,interval 1 month),'%Y-%m-01 00:00:00')
 and login_time < date_format(current_date,'%Y-%m-01 00:00:00')
2026-07-04 上月活跃用户数 
select count(distinct usr_id) from user_login_log 
 where login_time >= date_format(date_sub(current_date,interval 1 month),'%Y-%M-01 00:00:00')
 and login_time < date_format(current_date,'%Y-%M-01 00:00:00')
2026-07-04 上月活跃用户数 
select count(distinct usr_id) from user_login_log 
 where month(login_time)=month(current_date)-1
2026-07-03 上月活跃用户数 
select count(distinct usr_id) from user_login_log
where month(current_date)=month(login_time )+1
2026-07-03 上月活跃用户数 
select count(usr_id) from user_login_log
where month(current_date)=month(login_time )+1
2026-07-03 上月活跃用户数 
select * from user_login_log
2026-07-03 国庆假期后第一天涨幅高于1%的股票 
select ts_code, open_price, close_price
from daily_stock_prices
 WHERE 
    trade_date = '2023-10-09'
and pct_change>1
2026-07-03 每年在深交所上市的银行有多少家 
select year(list_date),count(distinct ts_code) 
from stock_info
where industry = '银行' 
and ts_code like '%SZ%'
group by year(list_date)
order by year(list_date)
2026-07-03 每年在深交所上市的银行有多少家 
select year(list_date),count(distinct name) from stock_info
group by year(list_date)
order by year(list_date)
2026-07-03 每年在深交所上市的银行有多少家 
select year(list_date),count(1) from stock_info
group by year(list_date)
order by year(list_date)
2026-07-03 一线城市历年平均气温 
select year(dt),
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-07-03 冬季下雪天数 
select city,
sum(case when con like '%雪%' then 1 else 0 end) snowy_days
from weather_rcd_china
where month(dt) in (12,1,2)
group by city
2026-07-03 冬季下雪天数 
select city,
count(1)
from weather_rcd_china
where month(dt) in (12,1,2)
and con like '%雪%'
group by city
2026-07-03 多云天气天数 
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)),'%') p
from weather_rcd_china 
where year(dt)=2021
group by city