牛客291451116号
牛客291451116号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客291451116号的博客
全部文章
(共21篇)
题解 | 找出每个学校GPA最低的同学
select device_id,university,gpa from user_profile where (university,gpa) in(select university,min(gpa) from user_profile group by university) order by...
2025-05-13
0
14
题解 | 截取出年龄
select substring_index(substring_index(profile,',',-2),',','1') as age,count(device_id) as number from user_submit group by age;
2025-05-13
0
12
题解 | 提取博客URL中的用户名
select device_id,substring_index(blog_url,'/',-1) as user_name from user_submit;
2025-05-12
0
10
题解 | 统计每种性别的人数
select substring_index(profile,',',-1) as gender,count(device_id) as number from user_submit group by gender; --主要是理解 substring_index函数,负数从右往左第N个分隔符右...
2025-05-12
0
10
题解 | 计算用户8月每天的练题数量
select day(date) as day,count(question_id) as question_cnt from question_practice_detail where date between '2021-08-01' and '2021-08-31' group by dat...
2025-05-12
0
14
题解 | 查看不同年龄段的用户明细
select device_id,gender, ( case when age is null then '其他' when age<20 then '20岁以下' when age>=25 then '25岁及以上' else '20-24岁' end ) as age_cut f...
2025-05-12
0
9
题解 | 计算25岁以上和以下的用户数量
方法一:使用if语句 select if(age<25 or age is null,'25岁以下','25岁及以上') as age_cut, count(device_id) as number from user_profile group by age_cut; 方法二:使用cas...
2025-05-09
0
12
题解 | 统计每个学校各难度的用户平均刷题数
select university,difficult_level,round(count(qpd.question_id)/count(distinct qpd.device_id) ,4) as avg_answer_cntfrom user_profile as up join questio...
2025-05-09
0
9
题解 | 统计每个学校的答过题的用户的平均答题数
select university,count(question_id) /count(distinct qpd.device_id) as avg_answer_cnt from user_profile as up inner join question_practice_detail as q...
2025-05-09
0
11
题解 | 浙江大学用户题目回答情况
select question_practice_detail.device_id, question_id, result from question_practice_detail inner join user_profile on question_p...
2025-05-09
0
9
首页
上一页
1
2
3
下一页
末页