牛客987852806号
牛客987852806号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客987852806号的博客
全部文章
/ 题解
(共37篇)
题解 | #查看不同年龄段的用户明细#
SELECTdevice_id,gender,case when age between 20 and 24 then '20-24岁'when age>=25 then '25岁以上' else '其他' end as age_cutfrom user_profile 考点 case wh...
SQL
2021-08-30
3
765
题解 | #统计每个用户的平均刷题数#
selectu1.university,q1.difficult_level,count(q.question_id)/count(distinct q.device_id)from user_profile u1 left join question_practice_detail q on u...
SQL
2021-08-30
0
462
题解 | #统计每个学校各难度的用户平均刷题数#
selectu.university,q1.difficult_level,count(q.question_id)/count(distinct q.device_id)from user_profile u inner join question_practice_detail q on...
SQL
2021-08-30
0
480
题解 | #浙江大学用户题目回答情况#
selectu.device_id,q.question_id,q.resultfrom question_practice_detail q left join user_profile u on q.device_id=u.device_idwhereu.university='浙江大学' 思路...
SQL
2021-08-30
0
430
题解 | #分组排序练习题#
SELECTuniversity,AVG(question_cnt)from user_profilegroup by universityorder by avg(question_cnt) 题目 要求求出每个大学的发帖的平均值,所以,我们先用group by 分组大学,然后,求出发帖平均值avg...
SQL
2021-08-30
2
557
题解 | #分组过滤练习题#
SELECTuniversity,avg(question_cnt),avg(answer_cnt)from user_profilegroup by universityhaving avg(question_cnt)<5oravg(answer_cnt)<20 考点group by...
SQL
2021-08-30
0
374
题解 | #分组计算练习题#
SELECTgender,university,count(device_id),avg(active_days_within_30),avg(question_cnt)from user_profilegroup by university,gender
SQL
2021-08-30
0
378
题解 | #计算男生人数以及平均GPA#
selectcount(gender),round(avg(gpa),1)from user_profileWHEREgender='male'group by gender 考点count聚合函数,avg平均值 group by 分组题目要求男性 where gender='male'要求算出男...
SQL
2021-08-30
0
639
题解 | #查找GPA最高值#
两种方法 where筛选 复旦大学条件,因最高的gpa,进行order by gpa desc降序,取第一行的数据即可select gpa from user_profileWHEREuniversity='复旦大学'order by gpa desc limit 1 2.where筛选 复旦大...
SQL
2021-08-30
63
2524
题解 | #查看学校名称中含北京的用户#
selectdevice_id,age,universityfrom user_profileWHEREuniversity like '%北京%' 考点 like 相似like '%北京%'列名包括北京的字样like '北京%' 列名北京开头like '%北京' 列名北京结尾
SQL
2021-08-30
34
2801
首页
上一页
1
2
3
4
下一页
末页