A-Z Popular Blog Databases Search »
Related Guides

What is a Unique Constraint?

 , updated on December 23, 2016
A unique constraint is a field or set of fields that must be unique for each row in a table. Data architects define unique constraints so that databases will automatically enforce the logical validity of data. Where a unique constraint is defined, the database will not permit duplicate values for the field or set of fields in the constraint definition.

Primary Key vs Unique Constraint

A primary key is a defined field or set of fields that a data architect identifies as the selected way to relate to a table. Once defined, all foreign keys that relate to the table must do so with the primary key. Only one primary key can be defined for a table.
A primary key automatically has a unique constraint applied to it. As only one primary key can be defined in a table, subsequent definitions to prevent duplicates in tables are defined with a unique constraint.


A CUSTOMER table has an ID as a primary key and NAME, MOBILE_PHONE as a unique constraint. Foreign keys relate to the table using ID. It is impossible to enter someone with the same name and mobile phone number into the table as the database will throw an error.
Overview: Unique Constraint
DefinitionA field or set of fields that must be unique for each row in a table.
ValuePrevents data duplication.
Related ConceptsPrimary Key
Foreign Key
Candidate Key

IT Skills

This is the complete list of articles we have written about it skills.
Artificial Intelligence
Big Data
Data Mining
Information Security
IT Examples
Legacy Software
Office Productivity
Problem Management
Process Automation
Service Delivery
Service Management
Software Design
If you enjoyed this page, please consider bookmarking Simplicable.


A list of database terms.

Primary Key vs Candidate Key

The difference between primary key and candidate key including an example.


The definition of atomicity with common examples.

Operational Database

A definition of operational database with examples.

Database Skills

A list of common database skills.

Row vs Column

The difference between row and column explained with examples.


An overview of data with a list of examples.

Types Of Data

The basic types of data.

Dark Data

The definition of dark data with examples.

Data Definition

Several useful definitions of data.


A definition of analytics with examples.

Data vs Information

The difference between data and information.

Hard Data vs Soft Data

The difference between hard data and soft data.

Human Readable

A definition of human readable.

Data Loss

The common types of data loss.
The most popular articles on Simplicable in the past day.

New Articles

Recent posts or updates on Simplicable.
Site Map