Understanding SQL Constraints
Relational database management systems allow you to control what data gets added to a table with constraints. A constraint is a special rule that applies to one or more columns — or to an entire table — that restricts what changes can be made to a table’s data. This article will go over in detail what constraints are and how they’re used in relational databases. It will also walk through each of the five constraints defined in the SQL standard and explain their respective functions.