Loading lesson path
Concept visual
Start at both ends
❮ SQL Keywords
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):
ADD CONSTRAINT PK_Person PRIMARY KEY (ID,LastName);command is used to delete a UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK constraint.
To drop a UNIQUE constraint, use the following SQL:
Formula
SQL Server / Oracle / MS Access:DROP CONSTRAINT UC_Person;DROP INDEX UC_Person;To drop a PRIMARY KEY constraint, use the following SQL:
Formula
SQL Server / Oracle / MS Access:DROP CONSTRAINT PK_Person;DROP PRIMARY KEY;To drop a FOREIGN KEY constraint, use the following SQL:
Formula
SQL Server / Oracle / MS Access:DROP CONSTRAINT FK_PersonOrder;DROP FOREIGN KEY FK_PersonOrder;To drop a CHECK constraint, use the following SQL:
Formula
SQL Server / Oracle / MS Access:DROP CONSTRAINT CHK_PersonAge;