一. 字段
1. 添加
alter table book add column book_id varchar not null , book_title varchar ( 10 ) default '' ;
2. 刪除
alter table book drop book_id, book_title;
alter table book drop book_id, book_title cascade ;
3. 修改類型
alter table book alter column book_title type varchar ;
4. 重命名
alter table book rename column book_title to book_name;
二、主鍵
1. 添加
alter table book add primary key ( book_id) ;
2. 刪除
alter table book drop constraint book_id;
三、約束
1. 增加
alter table book add conversion book_id_unique unique ( book_id) ;
alter table book alter column book_title set not null ;
2. 刪除
alter table book drop constraint book_id_unique;
alter table book alter column book_title drop constraint not null ;
四、默認值
1. 添加和修改
alter table book alter column book_title set default '無' ;
3. 刪除
alter table book alter column book_title dorp default ;
無、注釋
1. 表
comment on table book is '書' ;
2. 字段
comment on column book. book_id is '書ID' ;