MariaDB Table Constraints


Objectives

  • Understanding of MariaDB Table Constraints

  • MariaDB Table Constraints List


Understanding of MariaDB Table Constraints


MariaDB Table Constraints List

Constraints Name Description

NOT NULL

Ensures that a column cannot have a NULL value/s

UNIQUE

Ensures that all values in a column are different

PRIMARY KEY

A combination of a NOT NULL and UNIQUE. Uniquely identifies each row in a table

FOREIGN KEY

Reference of other table, which prevents actions that would destroy links between tables

CHECK

Ensures that the values in a column satisfies a specific condition

DEFAULT

Set the value if the column value not provided or empty

CREATE INDEX

Used to create and retrieve data from the database very quickly

AUTO_INCREMENT

Actually it’s not directly constraints, it allows a unique number to be generated automatically when a new record is inserted


MariaDB Table Constraints Video tutorial