DDL(Data Definition Language )语句:create,drop,alter,truncate;
对数据库、表操作。
create:
CREATE DATABSE DS_NAME;
CREATE TABLE TB_NAME(
COLUMN1 TYPE,
COLUMN2 TYPE,
. . .
)ENGINE=INNODB DEFAULT CHARSET=UTF8;
drop:
DROP TABLE TB_NAME;
DROP DATABASE DS_NAME;
alter:add、modify、change、drop
ALTER TABLE TB_NAME ADD COLUMN TYPE;
ALTER TABLE TB_NAME MODIFY COLUMN NEWTYPE;
ALTER TABLE TB_NAME CHANGE COLUMN NECOLUMN NEWTYPE;
ALTER TABLE TB_NAME DROP COLUMN;
truncate:
TRUNCATE TB_NAME;==TRUNCATE TABLE TB_NAME;
删除数据库只能drop。
来源:CSDN
作者:zyh_xf2017
链接:https://blog.csdn.net/qq_31839751/article/details/50075643