How Referential Integrity Constraint Is Implemented in Sql?
Relationships in a Database Are Implemented with Foreign Keys and Primary Keys. .. . the Referential Integrity Constraint Requires That Values in a Foreign Key...
Relationships in a database are implemented with foreign keys and primary keys. ... The Referential Integrity constraint requires that values in a foreign key column must either be present in the primary key that is referenced by the foreign key or they must be null.
How is referential integrity implemented in SQL?
Referential integrity requires that a foreign key must have a matching primary key or it must be null. This constraint is specified between two tables (parent and child); it maintains the correspondence between rows in these tables. It means the reference from a row in one table to another table must be valid.
How does SQL allow implementation of the entity integrity and referential integrity constraints?
- SQL allows implementation of the entity integrity by using the PRIMARY KEY and UNIQUE clause. Referential integrity is maintained by using the FOREIGN KEY clause. - Referential triggered actions can be specified by the designer, by using the SET NULL, CASCADE, and SET DEFAULT clauses.