Home > DB Concepts > DB Basics – Integrity Constraints in a Database (SQL Server)

DB Basics – Integrity Constraints in a Database (SQL Server)

Integrity constraints are used to ensure accuracy and consistency of data in a relational database. Data integrity allows to define certain data quality requirements that the data in the database needs to meet. If a user tries to insert data that doesn’t meet these requirements, the RDBMS will not allow so.

A Constraint is a property assigned to a column or the set of columns in a table that prevents certain types of inconsistent data values from being placed in the column(s). Constraints are used to enforce the data integrity. This ensures the accuracy and reliability of the data in the database.

CONSTRAINT = The threat or use of force to prevent, restrict, or dictate the action or thought of others.

–> There are 7 types of Constraints and they are grouped in to 4 types:

A. ENTITY INTEGRITY 1. Primary Key blog post video
2. Unique Key video
B. REFERENTIAL INTEGRITY 3. Foreign Key blog post video
C. DOMAIN INTEGRITY 4. NOT NULL blog post video


–> Check the video with discussion on all these Constraints:

Integrity Constraints

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: