牛客297995581号
牛客297995581号
全部文章
分类
题解(46)
归档
标签
去牛客网
登录
/
注册
牛客297995581号的博客
全部文章
(共48篇)
题解 | #查看不同年龄段的用户明细#
select device_id, gender, case when age >= 25 then '25岁及以上' when age >= 20 then '20-24岁' when age < 20 ...
Mysql
2022-03-18
0
212
题解 | #统计每个学校各难度的用户平均刷题数#
select case when age >= 25 then '25岁及以上' else '25岁以下' //这里注意用else:包含 null end as age_cut, count(*) number from user_profile group by age_cut;
Mysql
2022-03-18
0
235
题解 | #统计每个学校各难度的用户平均刷题数#
select device_id,gender,age,gpa from user_profile where university = '山东大学' union all select device_id,gender,age,gpa from user_profile where gender...
Mysql
2022-03-18
1
317
题解 | #统计每个学校各难度的用户平均刷题数#
select university, difficult_level, round((count(qpd.question_id)/count(distinct qpd.device_id)),4) as avg_answer_cnt //注意:共同列必须指明来自那张...
Mysql
2022-03-18
2
335
题解 | #统计每个学校的答过题的用户的平均答题数#
select university, round((count(question_id)/count(distinct q.device_id)),4) as avg_answer_cnt //保留四位小数;计算平均做题数:每个学校总题数/每个学校用户数(设备数-设备...
Mysql
2022-03-15
1
237
题解 | #浙江大学用户题目回答情况#
select device_id,question_id,result from question_practice_detail where device_id in (select device_id from user_profile where university = '浙江大学');//...
Mysql
2022-03-13
1
221
题解 | #浙江大学用户题目回答情况#
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
首页
上一页
1
2
3
4
5
下一页
末页