牛客987852806号
牛客987852806号
全部文章
分类
题解(45)
归档
标签
去牛客网
登录
/
注册
牛客987852806号的博客
全部文章
(共163篇)
题解 | #分组排序练习题#
SELECTuniversity,AVG(question_cnt)from user_profilegroup by universityorder by avg(question_cnt) 题目 要求求出每个大学的发帖的平均值,所以,我们先用group by 分组大学,然后,求出发帖平均值avg...
SQL
2021-08-30
2
559
题解 | #分组过滤练习题#
SELECTuniversity,avg(question_cnt),avg(answer_cnt)from user_profilegroup by universityhaving avg(question_cnt)<5oravg(answer_cnt)<20 考点group by...
SQL
2021-08-30
0
376
题解 | #分组计算练习题#
SELECTgender,university,count(device_id),avg(active_days_within_30),avg(question_cnt)from user_profilegroup by university,gender
SQL
2021-08-30
0
382
题解 | #计算男生人数以及平均GPA#
selectcount(gender),round(avg(gpa),1)from user_profileWHEREgender='male'group by gender 考点count聚合函数,avg平均值 group by 分组题目要求男性 where gender='male'要求算出男...
SQL
2021-08-30
0
641
题解 | #查找GPA最高值#
两种方法 where筛选 复旦大学条件,因最高的gpa,进行order by gpa desc降序,取第一行的数据即可select gpa from user_profileWHEREuniversity='复旦大学'order by gpa desc limit 1 2.where筛选 复旦大...
SQL
2021-08-30
64
2531
题解 | #查看学校名称中含北京的用户#
selectdevice_id,age,universityfrom user_profileWHEREuniversity like '%北京%' 考点 like 相似like '%北京%'列名包括北京的字样like '北京%' 列名北京开头like '%北京' 列名北京结尾
SQL
2021-08-30
39
2806
题解 | #操作符混合运用#
selectdevice_id,gender,age,university,gpafrom user_profilewheredevice_id in (select device_id from user_profile where gpa>3.5 and university='山东大学'...
SQL
2021-08-30
30
822
题解 | #高级操作符练习(2)#
SELECTdevice_id,gender,age,university,gpafrom user_profilewheregpa>3.7oruniversity='北京大学'考点or 或者条件是为 gpa大于3.7 或者 学校为北大的gpa>3.7oruniversity='北京大...
SQL
2021-08-30
0
455
题解 | #高级操作符练习(1)#
selectdevice_id,gender,age,university,gpafrom user_profileWHEREgpa>3.5andgender='male' 考点 where and 连接条件gpa要大于3.5(gpa>3.5)andgender要等男性(gender...
SQL
2021-08-30
3
823
题解 | #用where过滤空值练习#
题目意义是把age是null值筛选出来。selectdevice_id,gender,age,universityfrom user_profileWHEREage is not null 考点is not null 不为空的,那列呢age列(age is not null)
SQL
2021-08-30
33
4300
首页
上一页
8
9
10
11
12
13
14
15
16
17
下一页
末页