================================================
--建表以后仍然可以添加或者修改或删除约束 --商品的名字不能为空(非空约束使用modify) alter table goods modify goodsName not null; --身份证不重复(其余约束) alter table customer add constraint card_uni UNIQUE(cardId); --客户住址只能够在固定的六个地方('海淀','朝阳','东城','西城','通州','崇文') alter table customer add constraint address_check check(address in('海淀','朝阳','东城','西城','通州','崇文')); --删除约束 alter table 表名 drop constraint 约束名称; --删除主键约束的时候可能会出现错误,例如:alter table 表名 drop primary key; --因为如果两张表存在主从关系,那么删除主表的主键约束时候必须带上cascade(破坏主外键关系),例如: --alter table 表名 drop primary key cascade; ====================================================================表级定义 和 列级定义的区别:

