Alex_TD

2020年2月13日

Mysql--- 权限管理和备份

摘要: 1.权限管理:root 创建用户: create user chen identified by '123456 修改密码: update mysql.user set authentication_string='123456' where Host='localhost' and User='r 阅读全文

posted @ 2020-02-13 21:35 Alex_TD 阅读(170) 评论(0) 推荐(0) 编辑
Mysql---9 分页和排序

摘要: 1.分页 limit offset 和排序 order by desc 降序 asc 升序 select a.1,2,3,4 from a inner join b on a.1=b.1 inner join c on c.2=b.2 where 3='xxx' order by 4 desc (a 阅读全文

posted @ 2020-02-13 18:40 Alex_TD 阅读(153) 评论(0) 推荐(0) 编辑
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) 编辑