BCA / B.Tech 7 min read

Data Integrity in DBMS

Data Integrity in DBMS:

Data Integrity refers to the accuracy, consistency, and reliability of data stored in a database. It ensures that data is whole, correct, and not corrupted or altered in an unauthorized way. DBMS enforces data integrity through various constraints.

Types of Data Integrity:
  • Domain Integrity: Ensures that all values in a column are from a specified domain (i.e., a set of valid values). It is enforced by data types, CHECK constraints, and NOT NULL constraints.
  • Entity Integrity: Ensures that every table has a primary key, and that the primary key value is unique and not null. This guarantees that every row can be uniquely identified.
  • Referential Integrity: Ensures that relationships between tables remain consistent. It prevents entries in a related table if there is no corresponding entry in the primary table. This is enforced by foreign keys.
  • User-Defined Integrity: Business rules that are specific to an organization's needs and are not covered by the other integrity types. These are often implemented through triggers and stored procedures.