Importance of database Constraints
-
A constraint can be defined as the property assigned to a column or the set of columns in the database table which prevents inconsistent data values to be stored into the certain columns.
-
Constraints are used to ensure the data integrity. This enforce the reliability and accuracy of the data stored in the database.
-
In Relational Database Model, There are some Integrity Constraints which are used for accuracy and consistency of data in relational database.
-
Data integrity defines some data quality requirements that the data in the database needs to be met.
-
The Relational Database Management System will not allow, If a user tries to insert data that doesn’t meet these requirements.
Types of Constraints:
-
Entity Integrity constraint (Primary Key (PK) & Unique Key)
-
Referential Integrity constraint (Foreign Key (FK))
-
Domain Integrity constraint (NOT NULL, DEFAULT and CHECK Constraints)
Also Read:
- Transact-SQL(T-SQL) : Difference from SQL and PL/SQL?
- DBMS and most popular DBMS Software in 2019
- AWS vs Azure vs GCP: Which one is best (2019) ?