排名

用户解题统计

过去一年提交了

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

收藏

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

评论笔记

评论日期 题目名称 评论内容 站长评论
2025-04-15 至少两门科目大于等于110分的学生 
select 
	*
from
	subject_score
where
	(chinese>=110) + (math>=110) + (english>= 110)>=2
啥也没说
2025-04-10 冬季下雪天数 
输出示例中要求保留两位小数。参考答案中没有。
啥也没说
2025-03-27 大于J小于K的手牌 
select 
    * 
from 
    hand_permutations
where 
    card1 > 'J'  and card1 < 'K'
    and 
     card2 > 'J'  and card2 < 'K'
啥也没说
2025-03-27 大于J小于K的手牌 
--找出第一张牌、第二张牌都大于J且小于K的手牌。
--大于J且小于K的手牌不应该是皮蛋Q吗?疑惑。

啥也没说

提交记录

提交日期 题目名称 提交代码
2025-05-23 按歌手名字字符长度统计歌手个数 
select length(singer_name),
	count(singer_id)
from
	singer_info
group by
	length(singer_name)
2025-05-23 统计字符长度 
select 
	singer_name,
	char_length(singer_name) len
from
singer_info
2025-05-23 歌手名字大写 
select upper(singer_name) uppered_name
from
	singer_info
2025-04-15 特定歌曲的播放记录 
select * from listen_rcd
where
	song_id = 13
	and date(start_time) between "2023-12-10" and "2023-12-31"
order by
	start_time asc
2025-04-15 接收红包金额绿茶榜 
select 
	rcv_usr_id
	,sum(pkt_amt) sum_trx_amt
from 
	tx_red_pkt_rcd
where
	year(rcv_datetime) != 1900
group by
	rcv_usr_id
order by
	sum_trx_amt desc
limit 10
2025-04-15 接收红包金额绿茶榜 
select 
	rcv_usr_id
	,sum(pkt_amt) sum_trx_amt
from 
	tx_red_pkt_rcd
where
	year(rcv_datetime) != 1900
group by
	rcv_usr_id
order by
	sum_trx_amt desc
2025-04-15 红包金额土豪榜 
select 
	snd_usr_id,
	sum(pkt_amt) sum_trx_amt
from 
	tx_red_pkt_rcd
group by
	snd_usr_id
order by
	sum_trx_amt desc
limit 10
2025-04-15 总分超过300分的学生 
select student_id from subject_score
where chinese+math+english>=300
2025-04-15 至少两门科目大于等于110分的学生 
select 
	*
from
	subject_score
where
	(chinese>=110) + (math>=110) + (english>= 110)>=2
2025-04-15 渣男腰子可真行,端午中秋干不停 
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-04-15 渣男腰子可真行,端午中秋干不停 
select * from cmb_usr_trx_rcd
where
	usr_id = 5201314520
	and (trx_time between "2024-06-08" and "2024-06-10"
	or trx_time between "2024-09-15" and "2024-09-17")
2025-04-15 小结-行转列,展开学生成绩(1) 
select 
	exam_date
	, sum(case when subject="语文" then score else 0 end) as chinese_score
	, sum(case when subject="数学" then score else 0 end) as math_score
	, sum(case when subject="英语" then score else 0 end) as english_score
from
	scores
where
	student_id = 460093 
group by
	exam_date
2025-04-15 小结-行转列,展开学生成绩(1) 
select 
	exam_date
	, sum(case when subject="语文" then score else 0 end) as chinese_score
	, sum(case when subject="数学" then score else 0 end) as math_score
	, sum(case when subject="英语" then score else 0 end) as english_score
from
	scores
group by
	exam_date
2025-04-15 HAVING-语数英优异的学生 
select 
	student_id,
	sum(case when subject in ("语文","数学","英语") then score end) total_score
from
	scores
where
	exam_date = "2024-06-30"
group by
	student_id
having
	total_score>330
2025-04-15 HAVING-语数英优异的学生 
select 
	student_id,
	sum(case when subject in ("语文","数学","英语") then score end) total_score
from
	scores
where
	exam_date = "2024-06-30"
group by
	student_id
having
	total_score>=330
2025-04-15 HAVING-执教教师超过3人的科目 
select
	subject
from
	teachers
group by
	subject
having
	count(subject)>=3
2025-04-14 CASE WHEN-老中青教师数量 
select 
	case 
		when enter_date >= "2010-01-01" then "青年教师"
		when enter_date < "2000-01-01" then "资深教师"
		else "中年教师"
	end as teacher_type
	, count(1) teacher_count
from
	teachers
group by teacher_type
2025-04-14 CASE WHEN-老中青教师数量 
select 
	case 
		when enter_date >= "2010-01-01" then "青年教师"
		when enter_date < "2000-01-01" then "青年教师"
		else "中年教师"
	end as teacher_type
	, count(1) teacher_count
from
	teachers
group by teacher_type
2025-04-14 CASE WHEN-男女学生的数量 
select
	case when gender ="m" then "男" else "女" end as gender_text
	, count(1) student_count
from
	students
group by
	gender_text
2025-04-14 聚合函数-比较两位同学的数学成绩 
SELECT 
    student_id,
    MAX(score) AS max_score, 
    MIN(score) AS min_score, 
    AVG(score) AS avg_score
FROM scores
WHERE student_id IN (460093, 735011) AND subject = '数学'
GROUP BY student_id;