SQL语句-DDL
·修改表格的sql写法
-修改表格名称
?alter table TABLE_NAME rename to NEW_TABLE_NAME
-唯一性约束
?alter table TABLE_NAME add constraint UNIQUE_NAME unique(COLUMN_NAME)
-表格主键和外键
?alter table TABLE_NAME add constraint TABLE_PK_NAME primary key (COLUMN_NAME[,OTHER_COLUMN_NAME])
?alter table TABLE_NAME1 add constraint TABLE1_FK_NAME foreign key(FK_COLUMN_NAME) references TABLE2_NAME(FK_REF_PK)
?alter table TABLE_NAME drop constraint TABLE_CONSTRAINT
-字段
?alter table TABLE_NAME add NEW_COLUMN_NAME COLUMN_OPTION
?alter table TABLE_NAME modify COLUMN_NAME COLUMN_OPTION
?alter table TABLE_NAME drop column COLUMN_NAME