首页 > 数据库技术 > 详细

mysql (mariadb)表结构添加修改删除方法总结

时间:2017-12-27 16:58:11      阅读:329      评论:0      收藏:0      [点我收藏+]

1,添加表字段

    alter table table1 add ptel varchar(100) not Null;

    alter table table1 add id int unsigned not Null auto_increment primary key;

    alter table table1 add tj int(1) not Nul default ‘1‘;

2,修改表字段

   alter table 表名称 change 字段名称 字段名称 字段类型 [是否允许非空];

   alter table 表名称 modify 字段名称 字段类型 [是否允许非空];

   alter table 表名称 modify 字段名称 字段类型 [是否允许非空];

3,删除表字段

    alter table table1 drop 字段名

上述来自玖乐网络(96net.com.cn)

mysql (mariadb)表结构添加修改删除方法总结

原文:https://www.cnblogs.com/96net/p/8126163.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!