时间:2021-07-01 10:21:17 帮助过:3人阅读
ALTER TABLE demo1 RENAME `demo2`;#修改表单名
ALTER TABLE demo2 ADD `password` VARCHAR(32) NOT NULL;#添加字段
ALTER TABLE demo2 CHANGE `name` `username` CHAR(10) NOT NULL;#修改字段
ALTER TABLE demo2 DROP `password`;#删除字段
ALTER TABLE grade CHANGE `gradeID` `gradeId` INT(4) NOT NULL;
ALTER TABLE student CHANGE `gradeID` `gradeId` INT(4) NOT NULL;
ALTER TABLE grade ADD CONSTRAINT `pk_grade` PRIMARY KEY `grade`(`gradeId`);#添加主键约束
MySQL修改表
标签:varchar ble 约束 int 添加 add alt span color