bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL ADD CONSTRAINT Keyword

Concept visual

SQL ADD CONSTRAINT Keyword

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

ADD CONSTRAINT Keyword

Previous

❮ SQL Keywords

Next

Add 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);

Previous

❮ SQL Keywords

Next

Previous

SQL ADD Keyword

Next

SQL ALL Keyword