1. 程式人生 > 資料庫 >mysql教程(六) 對欄位的操作--新增、刪除、修改

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;