排名

用户解题统计

过去一年提交了

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

收藏

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

评论笔记

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

提交记录

提交日期 题目名称 提交代码
2026-03-19 不经过第二象限的所有函数 
SELECT *
FROM numbers_for_fun
WHERE
(a = 0 AND b = 0 AND c <= 0)
OR
(a = 0 AND b > 0 AND c <= 0)
OR
(a < 0 AND (
(b >= 0 AND c <= 0) OR
(b < 0 AND b*b <= 4*a*c)
))
ORDER BY a, b, c;
2026-03-19 不经过第二象限的所有函数 
select *
from numbers_for_fun
where 
(a > 0)
or
(a = 0 and ((b >= 0 and c > 0) or b <0))
or 
(a < 0 and c > 0)
2026-03-19 北京有雪的日子 
select dt, tmp_h, tmp_l, con
from weather_rcd_china
where con like '%雪%' and city = 'beijing'
2026-03-19 条件过滤-查找1994年至1997年毕业的女教师 
select name, subject, class_code, graduate_date
from teachers
where year(graduate_date) between 1994 and 1997
2026-03-19 条件过滤-符合条件的班主任 
select name, subject, class_code, qualification
from teachers
where (fir_degr = '北京大学' or fir_degr = '清华大学') and head_teacher is not null
order by name asc
2026-03-19 条件过滤-符合条件的班主任 
select name, subject, class_code, qualification
from teachers
where fir_degr = '北京大学' or fir_degr = '清华大学'
2026-03-19 条件过滤-符合条件的班主任 
select name, subject, class_code, qualification
from teachers
where fir_degr = '北京大学' or '清华大学'
2026-03-18 查询所有起点或终点为“海底捞西丽店”的行程记录 
select *
from didi_sht_rcd
where start_loc = '海底捞西丽店' or end_loc = '海底捞西丽店'
order by start_tm
2026-03-15 经过第四象限的所有函数 
SELECT *
FROM numbers_for_fun
WHERE
(a = 0 AND (
(b = 0 AND c < 0) OR
(b > 0 AND c < 0) OR
(b < 0)
))
OR
(a > 0 AND (
(c < 0) OR
(c >= 0 AND b < 0 AND b*b > 4*a*c)
))
OR
(a < 0);
2026-03-12 小结-行转列,展开学生成绩(1) 
select exam_date, 
	max(case when subject = '语文' then score end) as chinese_score,
max(case when subject = '数学' then score end) as math_score,
max(case when subject = '英语' then score end) as english_score
from scores
where student_id = '460093'
group by exam_date
2026-03-12 人数最多的学生姓氏 
select left(name, 1) as surname, count(*) as cnt
from students
group by surname
order by cnt desc
limit 5
2026-03-12 登录天数分布 
with user_login_days as(
	select
		usr_id,
		date(login_time) as login_date
	from 
	user_login_log
where
	login_time >= date_sub(curdate(), interval 180 DAY)
),
distinct_login_days as(
	select
		usr_id,
		count(distinct login_date) as login_days
	from
		user_login_days
	group by
		usr_id
)
select
	sum(case when 1<= login_days and login_days <= 5 then 1 else 0 end) as days_1_to_5,
sum(case when 6<= login_days and login_days <= 10 then 1 else 0 end) as days_6_to_10,
sum(case when 11<= login_days and login_days <= 20 then 1 else 0 end) as days_11_to_20,
sum(case when login_days > 20 then 1 else 0 end) as days_over_20
from
	distinct_login_days
2026-03-12 登录天数分布 
with user_login_days as(
	select
		usr_id,
		date(login_time) as login_date
	from 
	user_login_log
where
	login_time >= date_sub(curdate(), interval 180 DAY)
),
distinct_login_days as(
	select
		usr_id,
		count(distinct login_date) as login_days
	from
		user_login_days
	group by
		usr_id
)
select
	sum(case when login_days between 1 and 5 then 1 else 0 end) as days_1_to_5,
sum(case when login_days between 6 and 10 then 1 else 0 end) as days_6_to_10,
sum(case when login_days between 11 and 20 then 1 else 0 end) as days_11_to_20,
sum(case when login_days > 20 then 1 else 0 end) as days_over_20
from
	distinct_login_days
2026-03-12 登录天数分布 
with user_login_days as(
	select
		usr_id,
		date(login_time) as login_date
	from 
	user_login_log
where
	login_time >= date_sub(curdate(), interval 180 DAY)
),
distinct_login_days as(
	select
		usr_id,
		count(distinct login_date) as login_days
	from
		user_login_days
	group by
		usr_id
)
select
	sum(case when login_days between 1 and 5 then 1 else 0 end) as days_1_to_5,
sum(case when login_days between 1 and 5 then 1 else 0 end) as days_6_to_10,
sum(case when login_days between 1 and 5 then 1 else 0 end) as days_11_to_20,
sum(case when login_days between 1 and 5 then 1 else 0 end) as days_over_20
from
	distinct_login_days
2026-03-12 登录天数分布 
with user_login_days as(
	select
		usr_id,
		date(login_time) as login_date
	from 
	user_login_log
where
	login_time >= date_sub(curdate(), interval 180 DAY)
),
distinct_login_days as(
	select
		usr_id,
		count(distinct login_date) as login_days
	from
		user_login_days
	group by
		usr_id
)
select
	sum(case when 1< login_days <= 5 then 1 else 0 end) as days_1_to_5,
sum(case when 6< login_days <= 10 then 1 else 0 end) as days_6_to_10,
sum(case when 11< login_days <= 20 then 1 else 0 end) as days_11_to_20,
sum(case when login_days > 20 then 1 else 0 end) as days_over_20
from
	distinct_login_days
2026-03-12 登录天数分布 
with user_login_days as(
	select
		usr_id,
		date(login_time) as login_date
	from 
	user_login_log
where
	login_time >= date_sub(curdate(), interval 180 DAY)
),
distinct_login_days as(
	select
		usr_id,
		count(distinct login_date) as login_days
	from
		user_login_days
	group by
		usr_id
)
select
	sum(case when 1<= login_days <= 5 then 1 else 0 end) as days_1_to_5,
sum(case when 6<= login_days <= 10 then 1 else 0 end) as days_6_to_10,
sum(case when 11<= login_days <= 20 then 1 else 0 end) as days_11_to_20,
sum(case when login_days > 20 then 1 else 0 end) as days_over_20
from
	distinct_login_days
2026-03-12 通勤、午休、临睡个时间段活跃人数分布 
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 end) as commute,
count(distinct case 
when time(login_time) between '11:30:00' and '14:00:00' then usr_id end) as lunch_break,
count(distinct case
when time(login_time) between '22:30:00' and '23:59:59' then usr_id
when time(login_time) between '00:00:00' and '01:00:00' then usr_id end) as bedtime
from user_login_log
where 
	login_time >= date_format(date_sub(curdate(), interval 1 month), '%Y-%m-01')
and login_time < date_format(curdate(), '%Y-%m-01')
2026-03-11 国庆假期后第一天涨幅高于1%的股票 
select ts_code, open_price, close_price
from daily_stock_prices
where trade_date = '2023-10-09' and pct_change > 1
2026-03-11 国庆假期后第一天涨幅高于1%的股票 
select ts_code, open_price, close_price
from daily_stock_prices
where trade_date = '2023-10-08' and pct_change > 1
2026-03-11 国庆假期后第一天涨幅高于1%的股票 
select ts_code, open_price, close_price
from daily_stock_prices
where trade_date = 2023-10-08 and pct_change > 1