东陌寒
东陌寒
全部文章
题解
归档
标签
去牛客网
登录
/
注册
东陌寒的博客
全部文章
/ 题解
(共10篇)
题解 | #SQL类别高难度试卷得分的截断平均值#
select tag,difficulty,round((sum(score)-max(score)-min(score))/(count(score)-2),1) from examination_info ei join exam_record ...
Mysql
2021-10-25
18
1400
题解 | #删除索引#
方法一: alter table examination_info drop index uniq_idx_exam_id; alter table examination_info drop index&nb...
Mysql
2021-10-25
21
1535
题解 | #创建索引#
create index idx_duration on examination_info(duration); create unique index uniq_idx_exam_id on examination_info(e...
Mysql
2021-10-25
4
685
题解 | #删除表#
drop table if exists exam_record_2011; drop table if exists exam_record_2012; drop table if exists exam_record_2013; drop table if exists exam_record_...
Mysql
2021-10-25
1
481
题解 | #修改表#
alter table user_info add column school varchar(15) after level; alter table user_info change job profession varchar(10) ; alter table user_info modi...
Mysql
2021-10-25
15
1297
题解 | #创建一张新表#
create table user_info_vip( id int(11) primary key auto_increment comment'自增ID', uid int(11) unique not null comment '用户ID', nick_name varchar(64) co...
Mysql
2021-10-25
0
466
题解 | #提取博客URL中的用户名#
select device_id, SUBSTRING(blog_url,11) as username from user_submit substring(str,n,m)表示截取str,从第n位开始,一共截取m个字符,如果没有m,就是表示一直截取到最后
Mysql
2021-10-22
13
1162
题解 | #计算用户的平均次日留存率#
select count(q2.device_id)/count(q1.device_id) as avg_ret from (select distinct device_id,date from question_practice_detail) as q1 left join (selec...
Mysql
2021-10-22
16
764
题解 | #查找山东大学男生的GPA#
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
2021-10-21
2
491
题解 | #查询结果限制返回行数#
1.select device_id from user_profile limit 0,2 2.select device_id from user_profile limit 2 offset 2...
Mysql
2021-10-18
10
1712