操作对象表原状态
source
CREATE TABLE `student` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`birthday` datetime DEFAULT NULL,
`age` int(11) DEFAULT NULL,
`score` int(11) DEFAULT NULL,
`classid` int(11) DEFAULT NULL,
`sex` varchar(1) DEFAULT NULL COMMENT '性别',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8
在test 库的 student表中添加一列 kind
alter table test.student add column kind varchar(20) not null;
add column执行后的结果
删除test库中的student 表的kind列
alter table test.student drop column kind ;