牛客297995581号
牛客297995581号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客297995581号的博客
全部文章
/ 题解
(共42篇)
题解 | #浙江大学用户题目回答情况#
select q.device_id,question_id,result //注意:两个表***有的字段必须:表别名.字段名 指明来自那张表? from question_practice_detail q join user_profile u on q.device_id = u.device...
Mysql
2022-03-13
1
208
题解 | #分组排序练习题#
select university,avg(question_cnt) as avg_question_cnt from user_profile group by university order by avg_question_cnt;//默认升序
Mysql
2022-03-13
0
220
题解 | #分组过滤练习题#
select university, avg(question_cnt) as avg_question_cnt, avg(answer_cnt) as avg_answer_cnt from user_profile group by university having...
Mysql
2022-03-13
0
182
题解 | #分组过滤练习题#
select university, avg(question_cnt) as avg_question_cnt,//平均 avg(answer_cnt) as avg_answer_cnt//平均 from user_profile group by universit...
Mysql
2022-03-13
1
201
题解 | #分组计算练习题#
select gender, university, count(gender) user_num,//性别计数 avg(active_days_within_30) avg_active_days,//平均 avg(question_cnt) avg_question_cnt//平均 fr...
Mysql
2022-03-13
0
240
题解 | #计算男生人数以及平均GPA#
select count(gender) as male_num, round(avg(gpa),1) as avg_gpa from user_profile where gender = 'male'; 1.男性 2.计数:count() 3.平均:avg() 1.别名 2.round():...
Mysql
2022-03-13
0
224
题解 | #查询结果限制返回行数#
select device_id from user_profile limit 0,2; //limit x,y; x:起始记录的下标(第一题记录下标为0),y:共展示y条记录(包括下标为 x 的记录)
Mysql
2022-03-13
0
204
题解 | #查看学校名称中含北京的用户#
select gpa from user_profile where university = '复旦大学' order by gpa desc limit 0,1; //降序排列去第一名;limit 下标从0开始,取1条数据。
Mysql
2022-03-13
0
269
题解 | #查看学校名称中含北京的用户#
select round(max(gpa),1)//max() 求最大值。round(哪个值,小数点保留几位):四舍五入函数 from user_profile where university = '复旦大学';
Mysql
2022-03-13
10
286
题解 | #查找后多列排序#
select device_id,gpa,age from user_profile order by gpa asc,age asc; // order by gpa,age asc; 哪一列如何排,不指定如何排,默认升序 // order by gpa,age; 默认升序排列
Mysql
2022-03-13
7
626
首页
上一页
1
2
3
4
5
下一页
末页