操作对象表原状态
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

my sql 新增 删除一列

在test 库的 student表中添加一列 kind

alter table test.student add column kind varchar(20) not null;

add column执行后的结果
my sql 新增 删除一列

删除test库中的student 表的kind列

alter table test.student drop column kind ;

相关文章:

  • 2021-11-30
  • 2021-12-30
  • 2022-12-23
  • 2021-07-24
  • 2021-12-12
  • 2021-11-18
  • 2022-03-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2022-02-18
  • 2021-11-27
  • 2022-12-23
相关资源
相似解决方案