牛客987852806号
牛客987852806号
全部文章
分类
题解(45)
归档
标签
去牛客网
登录
/
注册
牛客987852806号的博客
全部文章
(共175篇)
题解 | #统计作答次数#
select count(uid),#问多少人来参与这次作答人数,有多少UID就有多少人 sum(case when submit_time is null then 0 else 1 end ) #统计多少人提交了做完了,求利sum()+case判断,当submit_time 是空等于0,不是空等...
Mysql
2021-10-27
5
888
题解 | #SQL类别高难度试卷得分的截断平均值#
select t.tag, t.difficulty, round( avg(t.score),1) from ( select e1.tag, e1.difficulty, e2.score, max(e2.score)over(partition by e2.exam_id ) as m, m...
Mysql
2021-10-27
2
659
题解 | #修改表#
alter table user_info add school varchar(15) after level; 增加列在某列之后 alter table 增加的表格 add 增加列的名称 数据类型 位置(after level...
Mysql
2021-10-27
173
4046
题解 | #创建一张新表#
create table user_info_vip ( id int(11) not null primary key auto_increment comment'自增ID', uid int(11) not null unique key comment'用户ID', nick_name ...
Mysql
2021-10-27
3
578
题解 | #商品交易(网易校招笔试真题)#小白做法,双表链接,提取题目要求的条件即可
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
502
题解 | #统计复旦用户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
18
1218
题解 | #找出每个学校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
498
题解 | #计算用户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
9
860
题解 | #查看不同年龄段的用户明细#
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
782
题解 | #统计每个用户的平均刷题数#
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
483
首页
上一页
9
10
11
12
13
14
15
16
17
18
下一页
末页