18-5 通过设计器实现约束

约束——保证数据完整性

数据库约束是为了保证数据的完整性(正确性)而实现的一套机制。

非空约束

主键约束(PK)primary key constraint 唯一且不为空

唯一约束(UQ)unigue constraint 唯一,允许为空,但只能出现一次

默认约束(DF)default constraint  默认值

检查约束(FK)check constraint 范围以及格式限制

外键约束(FK)foreign key constraint 表关系

增加外键约束时,设置级联更新、级联删除;

原文地址:https://www.cnblogs.com/Strugglinggirl/p/7181308.html