爱喝胡辣汤
爱喝胡辣汤
全部文章
分类
归档
标签
去牛客网
登录
/
注册
爱喝胡辣汤的博客
全部文章
(共45篇)
题解 | #浙江大学用户题目回答情况#
-- 本题涉及多表连接 -- 1.将question_practice_detail表与user_profile连接查询,条件为共有列device_id -- 2.过滤出university = '浙江大学'的记录即可 select qpd.device_id, question...
2023-06-28
0
154
题解 | #分组排序练习题#
select university, avg(question_cnt) avg_question_cnt from user_profile group by university order by avg_question_cnt 查看不同大学的用户平均发帖情况,...
2023-06-28
0
201
题解 | #分组过滤练习题#
SELECT university, format (AVG(question_cnt), 3) avg_question_cnt, format (AVG(answer_cnt), 3) avg_answer_cnt FROM user_profile GROUP ...
2023-06-28
0
145
题解 | #分组计算练习题#
SELECT gender, university, COUNT(*) user_num, AVG(active_days_within_30) avg_active_day, AVG(question_cnt) avg_question_cnt FROM ...
2023-06-27
0
136
题解 | #计算男生人数以及平均GPA#
select count(*) as male_num, avg(gpa) as avg_gpa from user_profile group by gender having gender = 'male'; 本题解使用了MySQL中的统计函数count(...
2023-06-27
0
240
题解 | #查找GPA最高值#
select format (max(gpa),1) from user_profile group by university having university = '复旦大学'; 本题用到MySQL中的数学函数FORMAT(number, decimal_pla...
2023-06-27
0
132
题解 | #查看学校名称中含北京的用户#
select `device_id`, `age`, `university` from `user_profile` where university like '%北京%'; 本题使用到了 模糊查询LIKE,LIKE与后面通配符字符串匹配。 %表示任何字符...
2023-06-27
0
139
题解 | #Where in 和Not in#
select `device_id`, `gender`, `age`, `university`, `gpa` from `user_profile` where `university` in ('北京大学', '复旦大学', '山东大学'...
2023-06-27
0
144
题解 | #查找某个年龄段的用户信息#
-- 方法1: # select # `device_id`, # `gender`, # `age` # from # `user_profile` # where # age >= 20 # and age <= 23; select ...
2023-06-27
0
126
题解 | #将查询后的列重新命名#
select `device_id` as `user_infos_example` from `user_profile` limit 0,2; 别名的命名: 方法1:列名/表名 AS 别名,如:`device_id` as `user_infos_example` 方...
2023-06-27
0
169
首页
上一页
1
2
3
4
5
下一页
末页