添加约束
SQL>alter table customer add constraint cardunique unique(cardId);
删除约束
SQL>alter table customer drop constraint addresscheck;
在删除主键的时候,必须带上cascade选项
SQL>alter table customer primary key cascade;
添加主键
SQL>alter table customer add constraint pkkey primary key(customerId);
查看约束信息
SQL> select constraint_name,table_name,r_owner,r_constraint_name
2 from all_constraints where table_name='goods' and table_name='customer';