Subject : DBMS Branch & Section : CSE – D
Max Marks : 5 Year & Semester : II - I
SEMINAR PRESENTION
Topic : Integrity Constraints In Relational Model In Dbms
Submitted by :
Name : Ch.Jathin
Roll no : 228R1A05L7 Submitted to :
Mrs.N.Anitha
Assistant Professor
Department of CSE
CMR Engineering College
Integrity Constraints In Relational Model In Dbms
Introduction to Integrity Constraints in Relational Model
• Integrity constraints ensure the accuracy, consistency, and
reliability of data in a relational databas e.
• They define rules and restrictions that must be followed when
inserting, updating, or deleting data.
• Integrity constraints help maintain the integrity of the data and
prevent data inconsistencies.
Types of Integrity Constraints
• Primary Key Constraint: Ensures uniqueness and non-null values
in a primary key column.
• Foreign Key Constraint: Maintains referential integrity by
enforcing relationships between tables.
• Unique Constraint: Guarantees uniqueness of values in a column
or a set of columns.
Primary Key Constraint
• A primary key constraint uniquely identifies each record in a table.
• It ens ures that the primary key column does not contain null
values.
• Primary key constraints are used to establish relationships
between tables.
Foreign Key Constraint
• A foreign key constraint establishes a relationship between two
tables.
• It ensures that values in a foreign key column exist in the
referenced primary key column.
• Foreign key constraints help maintain referential integrity and
enforce data consistency.
Unique Constraint
• A unique constraint ens ures that values in a column or a s et of
columns are unique.
• It allows null values but restricts duplicate non-null values.
• Unique cons traints are us ed to enforce uniqueness in a table.
Check Constraint
• A check constraint restricts the values that can be inserted or
updated in a column.
• It defines a condition that must be s atisfied for the data to be
considered valid.
• Check constraints are used to enforce business rules or
domain-specific requirements.
Not Nu l Constraint
• A not null cons traint ens ures that a column does not contain null
values.
• It guarantees that every record must have a value in the specified
column.
• Not null constraints help maintain data integrity and prevent data
inconsistencies.
Cascade and S et Nu l Actions
• Cascade action deletes or updates related records when the
referenced record is deleted or updated.
• It ensures that all dependent records are also deleted or updated
accordingly.
• S et null action sets the foreign key values to null when the
referenced record is deleted or updated.
Defer able Constraints
• Deferrable constraints allow flexibility in constraint checking
during transaction processing.
• They can be checked at the end of the transaction rather than
immediately after each statement.
• Deferrable constraints are useful when multiple constraints need
to be s atisfied simultaneously.
Enforcing Integrity Constraints
• Integrity constraints can be enforced through the database
management system.
• The D B M S automatically checks and enforces constraints during
data modifications.
• Violations of constraints result in an error and prevent the
transaction from completing.
Benefits of Integrity Constraints
• Ensure data accuracy and consistency.
• Prevent data inconsistencies and anomalies .
• Improve data quality and reliability.
Limitations of Integrity Constraints
• C onstraints can introduce some overhead in terms of
performance.
• Complex constraints may require additional resources for
processing.
• Constraints cannot capture all types of data validation rules.
Conclusion
• Integrity constraints are crucial for maintaining data integrity in a
relational database.
• They enforce rules and restrictions to ensure data accuracy,
consistency, and reliability.
• Understanding and implementing integrity constraints are
essential for building robust and reliable database systems.