冷凡社长
冷凡社长
全部文章
分类
题解(2)
归档
标签
去牛客网
登录
/
注册
冷凡社长的博客
TA的专栏
0篇文章
0人订阅
SQL题解
0篇文章
0人学习
全部文章
(共133篇)
题解 | #统计每个学校的答过题的用户的平均答题数#
select t.university,round(avg(num),4) as avg_answer_cnt from -- 思路先求出每个用户答题数 (select device_id,count(*) as num from question_practice...
Mysql
2022-07-14
0
269
题解 | #浙江大学用户题目回答情况#
select device_id,question_id,result from question_practice_detail where device_id in (select device_id from user_profile where unive...
Mysql
2022-07-14
4
224
题解 | #分组排序练习题#
select university,round(avg(question_cnt),4) as avg_question_cnt from user_profile group by university order by avg_question_cnt 主要考察排序的用法。排序默认是升序 asc...
Mysql
2022-07-14
0
231
题解 | #分组过滤练习题#
select university ,round(avg(question_cnt),3) as avg_question_cnt ,round(avg(answer_cnt),3) as avg_answer_cnt from user_profile group by university ...
Mysql
2022-07-14
0
230
题解 | #分组计算练习题#
select gender,university ,count(device_id) as user_num ,round(avg(active_days_within_30),1) as avg_active_day ,round(avg(question_cnt),1) as avg_quest...
Mysql
2022-07-14
0
168
题解 | #分组计算练习题#
select gender,university ,count(device_id) as user_num ,round(avg(active_days_within_30),1) as avg_active_day ,round(avg(question_cnt),1) as avg_quest...
Mysql
2022-07-14
0
202
题解 | #计算男生人数以及平均GPA#
select count(distinct device_id) as male_num ,avg(gpa) as avg_gpa from user_profile where gender = "male" 这个题主要是考察聚合函数的使用,这里为了避免人数出现重复,所以加入了...
Mysql
2022-07-14
1
243
题解 | #查找GPA最高值#
select max(gpa) as gpa from user_profile where university = "复旦大学" 求最值是SQL中非常经典的问题,不过这道题最让显示最大的gpa,没有别的信息 那么使用 max()是最简单的。记住不要忘记条件加上复旦大学,且列名...
Mysql
2022-07-14
0
203
题解 | #查看学校名称中含北京的用户#
select device_id,age,university from user_profile where university like "%北京%" 这里主要是考察like的用法,主要是记住%%的意思,%代表一个或多个字符。 一般都加在字符前后面。 北京%即为从以北京为开...
Mysql
2022-07-14
0
203
题解 | #操作符混合运用#
select device_id,gender,age,university,gpa from user_profile where (gpa > 3.5 and university = "山东大学") or (gpa > 3.8 and university = ...
Mysql
2022-07-14
0
190
首页
上一页
5
6
7
8
9
10
11
12
13
14
下一页
末页