此处的AFTER
是为了将stuno
字段的顺序添加到name
后面
ALTER TABLE student ADD stuno INT(11) AFTER name;
ALTER TABLE tb_test add id int;
ALTER TABLE tb_test DROP PRIMARY KEY;
ALTER TABLE tb_test ADD PRIMARY KEY (id ,name);
ALTER TABLE tb_test MODIFY id int AUTO_INCREMENT;