mysql教程(六) 对字段的操作--添加、删除、修改

1、添加字段

  alter table 表名 add column 列名 类型;//column 可省略

  示例:alter table t_student add contact_tel varchar(40);

2、修改字段

  alter table 表名 modify 列名 类型;

  示例:alter table t_student modify student_name varchar(100) ;

3、删除字段

  alter table 表名 drop 列名;

  示例:alter table t_student drop contact_tel;

 

posted @ 2020-12-10 12:22  爱好编程的王能能  阅读(145)  评论(0编辑  收藏  举报