牛客987852806号
牛客987852806号
全部文章
分类
题解(45)
归档
标签
去牛客网
登录
/
注册
牛客987852806号的博客
全部文章
(共21篇)
题解 | #商品交易(网易校招笔试真题)#小白做法,双表链接,提取题目要求的条件即可
select g.id, g.name, g.weight, sum(t.count) from goods g left join trans t on g.id=t.goods_id where g.weight<50 group by t.goods_id having sum(t....
Sqlite
SqL
2021-10-08
1
484
题解 | #统计复旦用户8月练题情况#
selectu1.device_id,u1.university,count(q.question_id),sum(case when q.result='right' then 1 else 0 end )from user_profile u1 left join question_pr...
SQL
2021-08-30
16
1194
题解 | #找出每个学校GPA最低的同学#
selectt.device_id,t.university,t.gpafrom(select *,dense_rank()over(partition by university order by gpa asc) as mfrom user_profile) as tWHEREt.m=1 窗口函...
SQL
2021-08-30
1
480
题解 | #计算用户8月每天的练题数量#
selectDATE_FORMAT(date,'%e') as day,count(question_id)from question_practice_detailWHEREDATE_FORMAT(date,'%Y-%m')='2021-08'group by day DATE_FORMAT(d...
SQL
2021-08-30
8
830
题解 | #查看不同年龄段的用户明细#
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
首页
上一页
1
2
3
下一页
末页