Skip to content
  • SiteMap
  • Our Services
  • Frequently Asked Questions (FAQ)
  • Support
  • About Us

UpdateGadh

Update Your Skills.

  • Home
  • Projects
    •  Blockchain projects
    • Python Project
    • Data Science
    •  Ai projects
    • Machine Learning
    • PHP Project
    • React Projects
    • Java Project
    • SpringBoot
    • JSP Projects
    • Java Script Projects
    • Code Snippet
    • Free Projects
  • Tutorials
    • Ai
    • Machine Learning
    • Advance Python
    • Advance SQL
    • DBMS Tutorial
    • Data Analyst
    • Deep Learning Tutorial
    • Data Science
    • Nodejs Tutorial
  • Blog
  • Contact us
  • Toggle search form
DBMS Integrity Constraints

DBMS Integrity Constraints – Ensuring Reliable Data in Relational Databases

Posted on July 12, 2025July 12, 2025 By Rishabh saini No Comments on DBMS Integrity Constraints – Ensuring Reliable Data in Relational Databases

DBMS Integrity Constraints

Maintaining consistent and correct data is essential in the database industry. A Database Management System (DBMS) must prevent invalid or inconsistent data entries that can corrupt relationships or produce unreliable results. This is where integrity constraints come into play.

A collection of guidelines known as integrity constraints are applied to database tables in order to preserve the accuracy, consistency, and legitimacy of the data. They ensure that the data modification operations like insertions, deletions, or updates do not compromise the integrity of the database.

Machine Learning Tutorial:-Click Here
Data Science Tutorial:-Click Here
Complete Advance AI topics:- CLICK HERE
Deep Learning Tutorial:- Click Here

What are Integrity Constraints?

Integrity constraints are predefined rules applied to table fields (columns) or relationships between tables in a DBMS. These constraints govern what kind of data is allowed, ensuring only valid and logical information is stored. Any operation that violates these constraints is automatically rejected, thus preventing accidental data corruption—even by authorized users.

These limitations can be defined in two primary ways:

  • Column Constraints: Defined as part of the column definition during table creation.
  • Table Constraints: Defined at the end of the CREATE TABLE statement and can apply to one or more columns.

Types of Integrity Constraints in DBMS

1. Domain Constraints

The acceptable range of values for a certain attribute is specified by domain constraints. The data type and permissible range of values for a column are specified by the domain. For example, a column storing employee age should not accept a string or a negative number.

Example:

emp_id   Name   Birth_year   Dept_id
10001    Raja   2000         001
10002    Tiya   2001         002
10003    Puja   1999         001
10004    Rohit  2002         B     ← Invalid (Dept_id should be numeric)

Here, the last row violates domain integrity because the Dept_id expects an integer, not a character.

Check Constraint:

Used to enforce domain-level rules by specifying a condition that values must satisfy.

Syntax (Column Level):

column_name datatype CONSTRAINT constraint_name CHECK (condition);

Syntax (Table Level):

CONSTRAINT constraint_name CHECK (condition);

NOT NULL Constraint:

Ensures that a column does not accept NULL values.

Syntax:

column_name datatype CONSTRAINT constraint_name NOT NULL;

2. Entity Integrity Constraints

Each table row can be uniquely identifiable thanks to entity integrity.This is enforced using a Primary Key, which must contain unique and non-null values.

Example:

Roll_no   Name    Birth_year
41        Akash   2009
23        Mina    2008
14        Rony    2010
NULL      Tina    2009   ← Invalid (Primary Key can't be NULL)

Since the main key field Roll_no is null in this instance, the final row violates the entity integrity constraint.

3. Referential Integrity Constraints

Consistent relationships between tables are guaranteed via referential integrity. It is enforced through foreign keys, which must either be NULL or match a primary key in the referenced table.

Example:

Students Table

Roll_no   Name     Branch_ID
11        Ronti    3
12        Priya    2
13        Puja     4     ← Invalid (Branch_ID 4 doesn't exist)

Branch Table

Branch_ID   Branch_Name
1           CSE
2           EE
3           ME

In this example, Branch_ID 4 in the Students table breaks the referential integrity because it doesn’t exist in the Branch table.

4. Key Constraints

Rows in a table can be uniquely identified with the use of key constraints.

Primary Key Constraint:

Each row is uniquely identified by a primary key, which also prevents duplicate or NULL values.

Syntax (Column Level):

column_name datatype CONSTRAINT constraint_name PRIMARY KEY

Syntax (Table Level):

CONSTRAINT constraint_name PRIMARY KEY (column_name1 [, column_name2])

Example:

emp_id   Name   Birth_year   Dept_id
10001    Raja   2000         001
10002    Tiya   2001         002
10001    Rohit  2002         003   ← Duplicate emp_id, violates primary key

Unique Key Constraint:

While allowing NULL values, a unique constraint guarantees that every value in a column or group of columns is unique.

Syntax (Column Level):

column_name datatype CONSTRAINT constraint_name UNIQUE

Syntax (Table Level):

CONSTRAINT constraint_name UNIQUE (column_name1 [, column_name2])

Primary Key vs Unique Key: Key Differences

AspectPrimary KeyUnique Key
Number of keys per tableOnly oneMultiple allowed
NULL valuesNot allowedAllowed
PurposeUniquely identifies each rowEnsures uniqueness for non-primary data

Complete Python Course with Advance topics:-Click Here
SQL Tutorial :-Click Here

Download New Real Time Projects :-Click here

Conclusion

Integrity constraints are essential for preserving the quality and consistency of data in a DBMS. They serve as a protective framework that enforces rules on data values and relationships, preventing errors and ensuring meaningful data handling.

The four primary types of DBMS integrity constraints—Domain Constraints, Entity Integrity, Referential Integrity, and Key Constraints—work together to ensure that data entered into a system is both valid and reliable.

By understanding and implementing these constraints properly, organizations can significantly improve their data integrity and make their database systems more robust and trustworthy.

Stay tuned with UpdateGadh for more insightful articles on databases and technology.


integrity constraints sql
integrity constraints in dbms
referential integrity constraints
referential integrity constraints in dbms
integrity constraints in dbms geeksforgeeks
integrity constraints in dbms types
integrity constraints in dbms with example
entity integrity constraints
acid properties in dbms
normalization in dbms
integrity constraints in database
integrity constraints example

    Post Views: 349
    DBMS Tutorial Tags:dbms integrity constraint in telugu, entity integrity constraints in dbms, integrity constraint in dbms telugu, integrity constraint in rdbms telugu, integrity constraints, integrity constraints dbms, integrity constraints in dbms, integrity constraints in dbms in hindi, integrity constraints in rdbms, integrity constraints over relations in dbms, rdbms integrity constraint in telugu, referential integrity constraints in dbms, types of integrity constraints in dbms

    Post navigation

    Previous Post: Big Mart Sales Prediction System using Python and Machine Learning
    Next Post: Why Do We Use Mixup Augmentation When Training Deep Learning Models?

    More Related Articles

    Lock-Based Protocol Lock-Based Protocol DBMS Tutorial
    DBMS Specialization DBMS Specialization DBMS Tutorial
    DBMS Tutorial DBMS Tutorial – Learn Database Management System DBMS Tutorial

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    You may also like

    1. What is a Database? Definition, Types, Examples
    2. ER Design Issues
    3. DBMS Specialization
    4. Relational Model in DBMS
    5. Relational Calculus
    6. Normalization in DBMS – A Complete Guide | Updategadh

    Most Viewed Posts

    1. Top Large Language Models in 2025
    2. Online Shopping System using PHP, MySQL with Free Source Code
    3. login form in php and mysql , Step-by-Step with Free Source Code
    4. Flipkart Clone using PHP And MYSQL Free Source Code
    5. News Portal Project in PHP and MySql Free Source Code
    6. User Login & Registration System Using PHP and MySQL Free Code
    7. Top 10 Final Year Project Ideas in Python
    8. Online Bike Rental Management System Using PHP and MySQL
    9. E learning Website in php with Free source code
    10. E-Commerce Website Project in Java Servlets (JSP)
    • AI
    • ASP.NET
    • Blockchain
    • ChatCPT
    • code Snippets
    • Collage Projects
    • Data Science Project
    • Data Science Tutorial
    • DBMS Tutorial
    • Deep Learning Tutorial
    • Final Year Projects
    • Free Projects
    • How to
    • html
    • Interview Question
    • Java Notes
    • Java Project
    • Java Script Notes
    • JAVASCRIPT
    • Javascript Project
    • JSP JAVA(J2EE)
    • Machine Learning Project
    • Machine Learning Tutorial
    • MySQL Tutorial
    • Node.js Tutorial
    • PHP Project
    • Portfolio
    • Python
    • Python Interview Question
    • Python Projects
    • PythonFreeProject
    • React Free Project
    • React Projects
    • Spring boot
    • SQL Tutorial
    • TOP 10
    • Uncategorized
    • Online Examination System in PHP with Source Code
    • AI Chatbot for College and Hospital
    • Job Portal Web Application in PHP MySQL
    • Online Tutorial Portal Site in PHP MySQL — Full Project with Source Code
    • Online Job Portal System in JSP Servlet MySQL

    Most Viewed Posts

    • Top Large Language Models in 2025 (8,614)
    • Online Shopping System using PHP, MySQL with Free Source Code (5,215)
    • login form in php and mysql , Step-by-Step with Free Source Code (4,869)

    Copyright © 2026 UpdateGadh.

    Powered by PressBook Green WordPress theme