标签:varchar ble 约束 int 添加 add alt span color
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`);#添加主键约束
标签:varchar ble 约束 int 添加 add alt span color
原文地址:http://www.cnblogs.com/binglong180/p/7732585.html