今天的学习内容:
修改mysql表结构
alter table 表名 change 字段 新字段 定义
alter table 表名 add 字段 定义
alter table 表名 drop 字段
修改索引
alter table 表名 add index 索引名 (字段名)
alter table 表名 drop index 索引名
修改主键
alter table 表名 add primary key 主键名 (字段名)
alter table 表名 drop primary key 主键名
更新插入功能
replace into 表名 (字段) values (值);
replace into 表名 set 字段='值',字段='值'
清空表记录和计数器
truncate table 表名
delete from 表名