Unique constraint
Meaning in databases & SQL, with examples
In databases & SQL, unique constraint means: A rule that stops two rows from having the same value in a column or combination of columns, for example two users with the same email address.
In Turkish: benzersizlik kısıtı, tekillik kısıtı, unique kısıtı
How it is used
Unlike a primary key, a table can have many unique constraints, and most databases let unique columns contain NULLs. Behind the scenes the database builds a unique index. Trying to insert a duplicate gives a 'duplicate key' or 'unique violation' error.
Example sentences
Add a unique constraint on email so the same person can't sign up twice.
The import stopped at row 812 because of a unique constraint violation.
Common collocations
- add a unique constraint
- unique index
- unique violation
- duplicate key error
Related terms
This word in other fields
The same English word can have a different meaning in another field:
More terms: Keys and Constraints
Practise with graded reading
Reading at the right level is the fastest way to make new words stick. Pick free English books by level:
