目录
数据库单词:
默认单词 | 单词说明 |
---|---|
innodb | 事务,主键,外键,tree,表行锁 |
myisam | 主要以插入读取和插入操作 |
memory | 所有数据保存在内存中 |
ACID | 原子性,一致性,隔离性,持久性 |
create,drop,alter | 表-增删改 |
insert,delete,update,select | 数据-增删改查 |
grant | 创建用户命令 |
identified | 确认密码 |
int、tinyint | 少量的数字 |
float、double | 小数 |
datetime、date | 年月日 |
char、varchar | char0-255、变长存储 |
unsigned | 无符号,将正数变成负数 |
default | 默认defalut 666 |
enmu,set: | 单选多选 |
表约束: | |
not null | 不可为空 |
not null unique | 主键 |
unique | 约束唯一 |
auto_increment | ID自增 |
primary key | 主键 |
foreign key | 外键:foreign key(id) references biao(sid) |
on delete cascade | 联级删除 |
on update cascade | 联级更新 |
单表查询: | |
distinct | 去重:select distinct 字段 from 表名 |
between | 范围:where 后面 between 100 and 200 |
is in | 判断,in 是否在元祖里面 |
like | 模糊查询%、下划线 |
group by | 分组:group by post |
count、max、min、avg、sum | 聚合函数 |
count、group by | 分组+聚合:函数放在from前面,分组放后 |
having | 筛选一般放在最后面:having count(id) > 3 |
order by desc、asc | 排序:odder by 字段 desc |
limit | 分页查询,限制查询次数,放在最后 limit 5,6 |