Monday, July 6, 2020

Integrity Constraints in DBMS

Integrity Constraints


Integrity Constraints are a set of rules. It is used to maintain the quality of information.
integrity constraints ensure that data entry, update, and other processes must be executed in a way that does not affect data integrity. Thus, integrity constraints are used to protect the DB from accidental damage.

Types of integrity constraints: -

  • 1) Domain constraints
  • 2) Entity integrity constraints
  • 3) Reference Integrity constraints
  • 4) Key constraints

1) Domain constraints

It can be defined as the definition of a valid group of values ​​for an attribute.
The data type of a domain includes string, characters, integers, time data, currency, etc. The value of the attribute must be available in the respective domain.

Domain constraints


2) Entity integrity constraints

Entity integrity constrains the condition that the primary key value cannot be null. This is because the primary key value is used to identify individual roles in the relationship and if the primary key has a null value. Then we cannot identify those lines or rows.
A table may contain a null value other than the primary key field. 

Entity integrity constraints

3) Reference Integrity constraints

It is a type of condition that provides the protection that the value of a set of attributes coming into one relation exists in another relationship in the set.

Reference Integrity constraints


4) Key constraints

The main constraint is the keys entity set that is used to identify an entity, which is used to identify an entity, with its unit set uniquely. An entity set can have multiple keys, but one of these keys will be the primary key.
The primary key does not have a unique and absolute value in the relation table.
Key constraints


There are some points for converting an ER diagram into a table

Entity type becomes a table: -

1. Lecturer, student, subject, syllabus, (personal table).
2. All single value attributes to be columns for the table.
3. Key features of the entity type represented by the primary key.
4. The multilevel attribute is represented by a separate table.
5. Composite properties represented by composites.
6. Derived attributes are not considered in the table.




Note: How did you like "Integrity Constraints in DBMS" post? Do let us know through comments. And share it with your friends too....

No comments:

Post a Comment