DROP CONSTRAINT

SQL DROP CONSTRAINT Keyword

The DROP CONSTRAINT command is used to delete a UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK constraint from a table.

Tutorials dojo strip

SQL DROP CONSTRAINT Syntax

SQL

SQL DROP a UNIQUE Constraint

SQL

Note: This syntax is not supported in SQLite, including our TechKubo playground. SQLite does not support dropping constraints after table creation.

SQL DROP a PRIMARY KEY Constraint

SQL

Note: Not supported in SQLite. Primary keys cannot be dropped using ALTER TABLE.

SQL DROP a FOREIGN KEY Constraint

SQL

Note: Not supported in SQLite. Foreign keys cannot be dropped using ALTER TABLE.

SQL DROP a CHECK Constraint

SQL

Note: Not supported in SQLite. Check constraints cannot be dropped using ALTER TABLE.

SQL DROP CONSTRAINT Labs

Tutorials dojo strip