3. Primary Key Constraint
•Most common constraint
•Doesn’t allow NULL or duplicates
•There can only be one per table
4. Unique Constraint
•Can be used when a table already has a Primary Key
•Does not allow duplicates, but DOES allow a NULL
5. Check Constraint
•Enforces domain integrity, data must conform
•Can refer to a single or multiple columns
•Example: column value must be > 3.
6. Default Constraint
•Useful for inserting data into “NOT NULL” columns
•Can be dynamic, example: Using GETDATE()
•Can be overridden with actual values
7. Foreign Key Constraint
•A value in the FK’d table exists as a Primary Key of a
table, usually a different one
•Verifies constraint on EXISTING data and NEW data
– “WITH NOCHECK” only verifies NEW data
8. Data Integrity
•Domain Integrity (Constraint on individual value)
– Check Constraints
•Entity Integrity (Looks at entire table)
– Primary Keys, Unique Constraints
•Referential Integrity (must exist in other table)
– Foreign Keys