1. ALTER
assign foreign key
ALTER TABLE table_name ADD foreign key(column_name) REFERENCES target_table_name(column_name) ON DELETE RESTRICT ON UPDATE RESTRICT;
assign primary key
ALTER TABLE table_name MODIFY column_name type primary key;
add auto increment property
ALTER TABLE table_name MODIFY column_name type auto_increment;
add not null property
ALTER TABLE table_name MODIFY column_name type not null;
'프로그래밍 > MySQL' 카테고리의 다른 글
[mysql] error 1045 : Access denied for user 'root'@'localhost' (using password: YES) (1) | 2012.03.06 |
---|---|
[mysql] 백업 (0) | 2012.01.31 |
[mysql] 기본 명령어 (0) | 2012.01.30 |