---
title: "Constraint — Database Glossary | Xata"
description: "A rule enforced by the database to maintain data integrity. Types include: PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL, and EXCLUDE. Constraints a..."
source: "https://xata.io/glossary/constraint"
---

# Constraint

Core Database

A rule enforced by the database to maintain data integrity. Types include: PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL, and EXCLUDE. Constraints are evaluated on every insert, update, or delete that affects the constrained columns.

Related terms

[Primary Key](/glossary/primary-key)[Foreign Key](/glossary/foreign-key)[Unique Constraint](/glossary/unique-constraint)

[← Back to glossary](/glossary)
