芋头炒冰
芋头炒冰
全部文章
分类
归档
标签
去牛客网
登录
/
注册
芋头炒冰的博客
全部文章
(共13篇)
题解 | #截取出年龄# 截取两遍是关键
正确题解: select substring_index(substring_index(profile,',',3),',',-1) as age, #重点 count(device_id) as number from user_submit group by age ⚠️Stella的两个迷糊...
2023-01-09
0
228
题解 | #统计每种性别的人数# substring_
正确题解1: select case when substring_index(profile,',',-1) ='male' then 'male' when substring_index(profile,',',-1) ='female' then 'female' end as gend...
2023-01-09
0
306
题解 | #计算25岁以上和以下的用户数量# case语句
正确题解: select case when age<25 or age is null then '25岁以下' when age>=25 then '25岁及以上' end as age_cut, count(device_id) as number from user_profi...
2023-01-09
1
476
题解 | #21年8月份练题总数# 三种限定时间条件的方法
正确题解: select count(distinct device_id) as did_cnt, count(question_id) as question_cnt from question_practice_detail where year(date)=2021 and month(da...
2023-01-08
0
307
题解 | #计算用户8月每天的练题数量# 关于时间的函数
正确题解: select day(date) as day, #day() count(question_id) as question_cnt from question_practice_detail where year(date)=2021 and month(date)=8 #year()...
2023-01-08
0
383
题解 | #查找山东大学或者性别为男生的信息# union
正确题解: select device_id, gender, age, gpa from user_profile where university = '山东大学' union all #本题重点 select device_id, gender, age, gpa from user_pr...
2023-01-08
0
268
题解 | #统计每个用户的平均刷题数# 第一次一次做对中等题
正确解法: select university, difficult_level, count(a.question_id) / count(distinct a.device_id) as avg_answer_cnt from question_practice_detail as a lef...
2023-01-08
0
268
题解 | #统计每个学校各难度的用户平均刷题数# 中等
正确解法: select university, difficult_level, round(count(a.question_id) / count(distinct a.device_id), 4) as avg_answer_cnt from question_practic...
2023-01-08
0
249
题解 | #统计每个学校的答过题的用户的平均答题数# 注意
解法: select university, count(b.question_id)/count(distinct b.device_id) as avg_answer_cnt from user_profile as a join question_practice_detail as b on...
2023-01-08
0
297
题解 | #浙江大学用户题目回答情况# 第一遍没做出来
解法1: select a.device_id, a.question_id, a.result from question_practice_detail as a, user_profile as b where a.device_id=b.device_id and b.university=...
2023-01-08
13
2468
首页
上一页
1
2
下一页
末页