ALTER
member table에 핸드폰 번호 필드 추가
ALTER TABLE [테이블 이름] ADD [추가할 필드명] AFTER [필드 위치]
mysql> ALTER TABLE members ADD youPhone varchar(20) not null;
Query OK, 0 rows affected (0.09 sec)
Records: 0 Duplicates: 0 Warnings: 0
member table에 주소 필드를 생일 필드 뒤에 추가
mysql> ALTER TABLE members ADD youAddress varchar(100) not null after youBirth;
Query OK, 0 rows affected (0.09 sec)
Records: 0 Duplicates: 0 Warnings: 0
필드 수정하기
ALTER TABLE [테이블 이름] MODIFY [수정할 필드명]
mysql> ALTER TABLE members MODIFY youPhone int(20) NOT NULL;
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0
필드 삭제하기
ALTER TABLE [테이블 이름] DROP [삭제할 필드명]
주소 필드 삭제하기
mysql> ALTER TABLE members DROP youAddress;
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0
핸드폰 번호 필드 삭제하기
mysql> ALTER TABLE members DROP youPhone;
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0