在mysql中,修改表注释的语句是“alter table 表名 comment '注释内容';”;alter语句用于修改一个表的结构,可以增加或者删除列,也可以改变表的注释和表的类型,comment属性用于表示注释。
本教程操作环境:windows10系统、mysql8.0.22版本、dell g3电脑。
mysql修改表注释的语句是什么“alter table 表名 comment '注释内容';”
altertable允许你修改一个现有表的结构。例如,你可以增加或删除列、创造或消去索引、改变现有列的类型、或重新命名列或表本身。你也能改变表的注释和表的类型。
alter常见用法
1:删除列
alter table 【表名字】 drop 【列名称】
2:增加列
alter table 【表名字】 add 【列名称】 int not null comment '注释说明'
3:修改列的类型信息
alter table 【表名字】 change 【列名称】【新列名称(这里可以用和原来列同名即可)】 bigint not null comment '注释说明'
4:重命名列
alter table 【表名字】 change 【列名称】【新列名称】 bigint not null comment '注释说明'
5:重命名表
alter table 【表名字】 rename 【表新名字】
6:删除表中主键
alter table 【表名字】 drop primary key
7:添加主键
alter table sj_resource_charges add constraint pk_sj_resource_charges primary key (resid,resfromid)
推荐学习:mysql视频教程
以上就是mysql修改表注释的语句是什么的详细内容。