站点图标 起风网

怎么修改mysql表的属性

      在项目中发现表里面的字段不够用了,这时候就可以添加字段需要用到alter 

       alter table 语句用于创建后对表的修改, 基础用法如下:

添加列

基本形式: alter table 表名 add 列名 列数据类型 [after 插入位置];

示例:

在表的最后追加列 address: alter table students add address char(60);

在名为 age 的列后插入列 birthday: alter table students add birthday date after age;

退出移动版