垫底菜鸡
垫底菜鸡
全部文章
分类
归档
标签
去牛客网
登录
/
注册
垫底菜鸡的博客
全部文章
(共53篇)
题解 | #计算25岁以上和以下的用户数量#
SELECT Case When age < 25 or age is null then '25岁以下' When age >= 25 then '25岁及以上' End age_cut,count(*)number from user_...
2023-03-03
0
177
题解 | #分组过滤练习题#
SELECT university, avg(question_cnt) as avg_question_cnt, avg(answer_cnt) as avg_answer_cnt from user_profile group by university having avg_question_...
2023-03-02
0
191
题解 | #分组计算练习题#
Select gender,university, count(device_id) as user_num, avg(active_days_within_30) as avg_active_days, avg(question_cnt) as avg_question_cnt from user...
2023-03-02
0
177
题解 | #计算男生人数以及平均GPA#
SELECT count(gender) as male_num,avg(gpa) as avg_gpa from user_profile where gender = 'male' 像这样聚合函数和聚合函数之间用,隔开,不要用and
2023-03-02
0
156
题解 | #查找GPA最高值#
Select round(max(gpa),1) from user_profile where university = '复旦大学' 没能想到聚合函数
2023-03-02
0
184
题解 | #查看学校名称中含北京的用户#
select device_id,age,university from user_profile where university like ('北京%') 虽然可以想到like,但是后续的%还是看了题解
2023-03-02
0
172
题解 | #操作符混合运用#
SELECT device_id,gender,age,university,gpa from user_profile where (gpa>3.5 and university in ('山东大学') ) or (gpa>3.8 and university in ('复旦大学'))...
2023-03-02
0
185
题解 | #Where in 和Not in#
select device_id,gender,age,university,gpa from user_profile where university in ('山东大学','北京大学','复旦大学') in想到了,括号没有,万万没想到university打错了
2023-03-02
0
185
题解 | #高级操作符练习(2)#
SELECT device_id,gender,age,university,gpa from user_profile where gpa > 3.7 or university = '北京大学' 同类题,只是换为or
2023-03-02
0
185
题解 | #高级操作符练习(1)#
Select device_id,gender,age,university,gpa from user_profile where gpa>3.5 and gender = 'male' 相同的需要写and连接
2023-03-02
0
141
首页
上一页
1
2
3
4
5
6
下一页
末页