0% found this document useful (0 votes)
550 views2 pages

Integrity Constraints

Integrity constraints are predefined rules in database management systems that ensure data validity and consistency. They evaluate operations like inserts, updates, and deletes to confirm the results are true before allowing the changes. This prevents accidental damage to the database. There are several types of integrity constraints including domain, entity, referential, and key constraints that restrict column values, enforce primary keys, validate relationships between tables, and define unique identifiers.

Uploaded by

Ayush Aggarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
550 views2 pages

Integrity Constraints

Integrity constraints are predefined rules in database management systems that ensure data validity and consistency. They evaluate operations like inserts, updates, and deletes to confirm the results are true before allowing the changes. This prevents accidental damage to the database. There are several types of integrity constraints including domain, entity, referential, and key constraints that restrict column values, enforce primary keys, validate relationships between tables, and define unique identifiers.

Uploaded by

Ayush Aggarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Integrity Constraints in DBMS

In database management systems (DBMS) there is a certain set of rules which are
used to maintain the quality and consistency of data in the database. Every time
there is an insertion, deletion, or updating of data in the database it is the
responsibility of these integrity constraints to maintain the integrity of data and
thus help to prevent accidental damage to the database.
What are Integrity Constraints in DBMS?

In Database Management Systems, integrity constraints are pre-defined set of rules that are
applied on the table fields(columns) or relations to ensure that the overall validity, integrity,
and consistency of the data present in the database table is maintained. Evaluation of all the
conditions or rules mentioned in the integrity constraint is done every time a table insert,
update, delete, or alter operation is performed. The data can be inserted, updated, deleted,
or altered only if the result of the constraint comes out to be True. Thus, integrity
constraints are useful in preventing any accidental damage to the database by an authorized
user.

Types of Integrity Constraints

Domain Constraint

Domain integrity constraint contains a certain set of rules or conditions to restrict the kind of
attributes or values a column can hold in the database table. The data type of a domain can
be string, integer, character, DateTime, currency, etc.

Entity Integrity Constraint

Entity Integrity Constraint is used to ensure that the primary key cannot be null. A primary
key is used to identify individual records in a table and if the primary key has a null value,
then we can't identify those records. There can be null values anywhere in the table except
the primary key column.

Referential Integrity Constraint

Referential Integrity Constraint ensures that there must always exist a valid relationship
between two relational database tables. This valid relationship between the two tables
confirms that a foreign key exists in a table. It should always reference a corresponding value
or attribute in the other table or be null.

Key constraint

Keys are the set of entities that are used to identify an entity within its entity set uniquely.
There could be multiple keys in a single entity set, but out of these multiple keys, only one key
will be the primary key. A primary key can only contain unique and not null values in the
relational database table.

You might also like