Integrity Constraints
Integrity Constraints
ID Name Salary
Example:
Consider Employees table having Id, 1101 Jackson 40000
Name, and salary of employees 1102 Harry 60000
In the above employee's table, we can 1103 Steve 80000
see that the ID column is the primary 1104 Ash 1800000
key and contains a null value in the last Null James 36000
row which violates the entity
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.
Row having DeptID=4 violates the referential integrity constraint since DeptID 4 is
not defined as a primary key column in the Departments table.
Key constraint