表管理
增加一個字段
alter table 表名 add (字段名 字段類型);
修改一個字段的類型
alter table 表名 modify (字段名 字段類型);
刪除一個字段
alter table 表名 drop column 字段名;
顯示錶結構
desc 表名;
修改表名
rename 舊錶名 to 新表名;
刪除數據的兩種方式
delete from 表名 where [條件]; -- 指定刪除,不帶條件全部刪除;
可設置保存點(savepoint pointname),回滾找回數據。
truncate table 表名; -- 刪除全部,不會寫日誌,速度快但數據不能找回