牛客461688170号
牛客461688170号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客461688170号的博客
全部文章
/ 题解
(共19篇)
题解 | #查找山东大学男生的GPA#
题意: 分别查看学校为山东大学或者性别为男性的用户的device_id、gender、age和gpa数据 分解: 由学校为山东大学或性别为男性,知:university='山东大学', gender='male' 由分别查看,知不去重,即:union all 代码: select devic...
Mysql
2021-11-30
4
553
题解 | #统计每个用户的平均刷题数#
题意:参加了答题的山东大学的用户在不同难度下的平均答题题目数 分解: 由山东大学的用户,知: university=‘山东大学’ 由不同难度,知: group by difficult_level 由平均答题数,知: count(question_id)/count(distinct(devi...
Mysql
2021-11-30
0
429
题解 | #统计每个学校各难度的用户平均刷题数#
题意: 计算每个学校用户不同难度下的用户平均答题题目数情况 分解: 根据每个学校的用户,知 group by university 根据不同难度,知 group by difficult_level 根据用户平均答题题目数,知 count(q.question_id) / count(dis...
Mysql
2021-11-30
0
411
题解 | #浙江大学用户题目回答情况#
select b.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='浙江大学'
Mysql
2021-11-29
0
356
题解 | #浙江大学用户题目回答情况#
select a.device_id,a.question_id,a.result from question_practice_detail a,user_profile b where a.device_id=b.device_id and b.university='浙江大学'
Mysql
2021-11-01
1
316
题解 | #分组过滤练习题#
having用于聚合函数的筛选, where中不能使用聚合函数 where子句在聚合前先筛选记录,也就是说作用在group by 子句和having子句前,而 having子句在聚合后对组记录进行筛选 select university,avg(question_cnt) as ave_...
Mysql
2021-10-21
15
778
题解 | #分组计算练习题#
select gender,university, COUNT(device_id) as user_num,avg(active_days_within_30),avg(question_cnt) from user_profile group BY university,gender
Mysql
2021-10-21
0
386
题解 | #操作符混合运用#
select device_id,gender,age,university,gpa from user_profile where (gpa>3.5 and university='山东大学') or (gpa>3.8 and university='复旦大学')
Mysql
2021-10-21
0
307
题解 | #Where in 和Not in#
select device_id,gender,age,university,gpa from user_profile where university in ('北京大学','复旦大学','山东大学')
Mysql
2021-10-21
3
656
首页
上一页
1
2
下一页
末页