Alex_TD

上一页 1 ··· 4 5 6 7 8 9 10 下一页

2020年2月13日

Mysql--13 索引

摘要: 1.索引:提高获取数据速度 索引分类: 1.主键索引:primary key 唯一,主键唯一,一个表只能有一个列作为主键。 2.唯一索引:unique key 可以标注多列为唯一索引, 3.常规索引:(key /index)key 索引名(字段名) 4.全文索引: fulltext index 索引 阅读全文

posted @ 2020-02-13 17:11 Alex_TD 阅读(241) 评论(0) 推荐(0) 编辑
Mysql ---12 事务

摘要: 1.事务: 多条数据库操作语句DML DQL同时成功或同时失败 参考文章:https://blog.csdn.net/Jocker_D/article/details/87384673 原子性:成功都成功,失败都失败 一致性:多用户数据一致 持久性:事务提交或未提交前后数据 隔离性: 多用户互不影响 阅读全文

posted @ 2020-02-13 15:53 Alex_TD 阅读(152) 评论(0) 推荐(0) 编辑
Mysql ---11(聚合函数)

摘要: 1.聚合函数: select * from user where concat(use,addr) like "%"#{name}"%"; 1.count() count(字段)忽略所有null count(*) 不忽略null count(1) 不忽略null 2.sum() 3.avg() 4. 阅读全文

posted @ 2020-02-13 15:01 Alex_TD 阅读(122) 评论(0) 推荐(0) 编辑
Mysql---10 运算 字符串 日期 加密 系统相关函数

摘要: 1.子查询和嵌套查询: where id=(嵌套查询) 常用函数: 1.ABS(-10) 10 2.CELLING(10.2) 11 3.floor(10.2) 10 4.rand() ==随机0-1 5.sign(-10)==负数返回-1 正数返回 1 6.char_length('fdsfadf 阅读全文

posted @ 2020-02-13 14:29 Alex_TD 阅读(139) 评论(0) 推荐(0) 编辑
Mysql----8 联表查询 嵌套查询 inner join on left join on right join on

摘要: 1.联表查询 必须多表要有相同的列 (多表查询) select a.name,sex,password from 表1 as a inner join 表2 as b on a.name=b.name; select a.name ,password, sex from 表1 as a left j 阅读全文

posted @ 2020-02-13 13:29 Alex_TD 阅读(734) 评论(0) 推荐(0) 编辑
Mysql---7 where 条件语句

摘要: 1.where 条件 1.and && or || Not ! where Nnot Id='001'; 2. is NULL > id is null is null ' '; is not NULL > id is not null between and > id between a and 阅读全文

posted @ 2020-02-13 11:45 Alex_TD 阅读(112) 评论(0) 推荐(0) 编辑
Mysql---6 Select 查询数据的方式

摘要: 1.DQL select 指定查询字段: select * from 表名; select * from 表名 where username='xxxx'; select * from 表名 where username is NULL; select username as ‘用户名’,passw 阅读全文

posted @ 2020-02-13 11:14 Alex_TD 阅读(144) 评论(0) 推荐(0) 编辑

2020年2月12日

Mysql---5(DML) 外键constraint不推荐 表中数据的insert into values update set where delete from where truncate

摘要: 1.constraint FK_keyname foreign key (key name) reference table2(`key`) 数据库级别的外键不建议使用 2.DML 插入表数据: insert into tablename(key1,key2,..)values(value1,val 阅读全文

posted @ 2020-02-12 20:23 Alex_TD 阅读(153) 评论(0) 推荐(0) 编辑
Mysql---4 修改表字段操作(增,删,改,重命名)

摘要: 1.修改表名: alter table [表1] rename as [表2] 2.增加表字段: alter table [table1] add column 列名 INT(4)--数据类型 3.修改表字段:change 重名字段名 modify 修改字段数据类型和约束 alter table [ 阅读全文

posted @ 2020-02-12 15:49 Alex_TD 阅读(1106) 评论(0) 推荐(0) 编辑
Mysql ---3创建表

摘要: 1.创建表:注意:` ` ' ' , 三种符号 if not exists primary key(`id`)engine= innodb charset=utf8 create table if not exists `stu`( `id` int(4) auto_increment commen 阅读全文

posted @ 2020-02-12 15:05 Alex_TD 阅读(166) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 下一页