黑桃老法师
黑桃老法师
全部文章
分类
题解(32)
归档
标签
去牛客网
登录
/
注册
杨硕琦太调皮了
倘若你的眼神一直这么冰冷,某人的心会结冰的
TA的专栏
0篇文章
0人订阅
学习记录
0篇文章
0人学习
全部文章
(共30篇)
题解 | #得分不小于平均分的最低分#
这题没有写出来 参考大佬的 select min(er.score) as min_score_over_avg from exam_record er join examination_info ei on er.exam_id = ei.exam_id where ei.tag = 'SQL'...
Mysql
2022-01-15
0
124
题解 | #SQL类别高难度试卷得分的截断平均值#
保留一位 (count(ss),1) select tag, difficulty, round((sum(score) - max(score) - min(score)) / (count(score) - 2), 1) as clip_avg_score from exam_reco...
Mysql
2022-01-15
0
172
题解 | #删除索引#
删除索引 drop index uniq_idx_exam_id on examination_info; drop index full_idx_tag on examination_info;
Mysql
2022-01-15
0
202
题解 | #创建索引#
索引 # 在duration列创建普通索引idx_duration、 # 在exam_id列创建唯一性索引uniq_idx_exam_id、 # 在tag列创建全文索引full_idx_tag。 create index idx_duration on examination_info(durati...
Mysql
2022-01-15
0
169
题解 | #修改表#
关于alter table #字段level的后面增加一列最多可保存15个汉字的字段school; #并将表中job列名改为profession,同时varchar字段长度变为10; #achievement的默认值设置为0 alter table user_info add school var...
Mysql
2022-01-15
0
207
题解 | #创建一张新表#
建表 备注 comment '' 主键 primary key unique key default xxx create table user_info_vip( id int(11) not null auto_increment primary key comment '自增ID',...
Mysql
2022-01-12
0
195
题解 | #删除记录(三)#
1.DROP TABLE 清除数据并且销毁表,是一种数据库定义语言(DDL Data Definition Language), 执行后不能撤销,被删除表格的关系,索引,权限等等都会被永久删除。 2.TRUNCATE TABLE 只清除数据,保留表结构,列,权限,索引,视图,关系等等,相当于清零数据...
Mysql
2022-01-12
23
886
题解 | #删除记录(二)#
**空或者时间小于5 用到了 is null, timestampdiff ** delete from exam_record where submit_time is null or timestampdiff(minute, start_time, submit_time) < 5 o...
Mysql
2022-01-12
0
160
题解 | #删除记录(一)#
/* 知识点: timestampdiff查询两个时间以第一参数为单位的差 删除记录的方式汇总: 1)根据条件删除:delete from tb_name[where options] [[order by fields] limit n] 2) 全部删除(表清空,包含自增计数器重置):trunca...
Mysql
2022-01-12
0
151
题解 | #更新记录(二)#
**判空 用is null 不是 = null ** update exam_record set submit_time = '2099-01-01 00:00:00', score = 0 where start_time < '2021-09-01 00:00:00' and subm...
Mysql
2022-01-12
0
156
首页
上一页
1
2
3
下一页
末页