Easy Tutorial
❮ Func Date Sub Sql Intro ❯

SQL Constraints

SQL constraints are used to specify rules for the data in a table.

If there is any violation of the constraints, the action is aborted by the constraint.

Constraints can be specified when the table is created (with the CREATE TABLE statement) or after the table is created (with the ALTER TABLE statement).

SQL CREATE TABLE + CONSTRAINT Syntax

In SQL, we have the following constraints:

In the following sections, we will go into detail about each constraint.

❮ Func Date Sub Sql Intro ❯