Constraints help us to prevent invalid data entry into tables. Using constraints we can:
There are several constraints are as follows:
|Not null||Specifies that the column can't contain a null value.|
|Unique||Specifies a column or combination of columns whose values must be unique for all rows in the table.|
|Primary key||Uniquely identifies each rows of the table.|
|Foreign key||Established and enforces a foreign key relationship between the column and a column of the referenced table.|
|Check||Specifies a condition that must be true.|
All constraints are stored in data dictionary. Constraints are easy to refer if we give them meaningful names. If we dont give a name to a constraint , the server gives a name by its own.