标签:ima prim efault sql primary add col nbsp _id
DROP TABLE IF EXISTS `student`; CREATE TABLE `student` ( `stu_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`stu_id`), UNIQUE KEY `UK_student_name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
create unique index UK_student_name on student (name);
建表后添加约束
alter table student add constraint uk_student_name unique (name);
标签:ima prim efault sql primary add col nbsp _id
原文地址:https://www.cnblogs.com/bigtreei/p/9126000.html