# Constraint

*noun*

say it: **“kun-STRAYNT”** **/kənˈstreɪnt/**

A rule the database enforces on a table's data, such as NOT NULL, UNIQUE or a foreign key.

## What does **Constraint** do in a relational database?

**Constraint** — A rule the database enforces to protect valid and consistent data.

## In a sentence

- “A **constraint** stops anyone saving a product with a negative price.”

Level: Novice · [More Database terms at this level](https://www.ask-codey.com/glossary?category=database&level=1)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/constraint
