Constraints Flashcards
0
Q
Constraint syntax
A
CONSTRAINT nameOconstrsaint UNIQUE(column2addconstrainton)
1
Q
Types of constraints
A
Primary key - ensures each row has a uniqueID
Foreign key - ensures FK points to valid PK
Check constraint - enforces formulas (check clauses) defined on a column.
Unique - no 2 rows can have same unique values.
NOT NULL - does not allow NULL values
Note: there can only be 1 NULL entry