SQLのテーブル定義を変更するalter文の使い方メモ(MySQLで検証)
# テーブル名の変更
alter table target_table rename to new_table;
# カラム名の変更
alter table target_table rename target_column to new_column;
# カラム定義の変更
alter table target_table modify target_column [新しいカラム定義];
## (例)alter table target_table modify target_column varchar(20) default NULL;
# 新しいカラムの追加
alter table target_table add new_column [カラム定義]
## (例)alter table target_table add new_column varchar(20) default NULL;