Flash cards
Review the key moves
1/4
Core idea
What is the main idea behind SQL ADD CONSTRAINT Keyword?
Lesson checks
Practice each idea before moving on
Short Mimo-style checks built from this lesson's code, terms, and sequence.
1Quick choice
Which statement best captures the main point of this lesson?
2Fill blank
Complete the missing token from the example code.
___ TABLE PersonsAdd Constraint
The ADD CONSTRAINT command is used to create a constraint after a table is already created.
The following SQL adds a constraint named "PK_Person" that is a PRIMARY KEY constraint on multiple columns (ID and LastName):
Example
ALTER TABLE Persons
ADD CONSTRAINT PK_Person PRIMARY KEY (ID,LastName);