Which of the following statements is true about referential integrity?

Which of the following statements is true about referential integrity?

Which of the following statements is true about referential integrity?

A.
It checks that no component of a primary key can have a null value and no duplicate entries can exist.

B.
It checks that the value of a primary key must beconsistent throughout the life of an instance.

C.
It distinguishes between null values and zero entries.

D.
It checks that no record in a child table can exist if its corresponding record is not available in the parent
table.

Explanation:
Referential integrity is enforced through a foreignkey. There must be a reference of the foreign key in its
originating table. For example, take
two tables, Employee and Department. The DeptID attribute of the Department table is the primary key, and
when it is exported to Employee
table, it becomes the foreign key in the Employee table. The data value of DeptID in the Employee table cannot
exist if it does not exist in the Department table.

Referential integrity constraint is a feature in RDBMS (Relational Database Management System) that prevents
a user from entering
inconsistent data. There are various referential integrity rules that are applied on tables sharing a relationship.
These are as follows:
If the Employee table has a foreign key that is a primary key of the Department table, then the Employee table
cannot have a value in
the foreign key column if there is no correspondingvalue in the Department table. If a record is deleted from
the Department table, the corresponding record mustbe deleted from the Employee table. This is known as
cascading delete.
Answer C is incorrect. According to an integrity constraint, a table can have only one primary key constraint. A
primary key constraint imposes that the primary keyattribute should be unique and cannot have NULL values.
This ensures that the primary key value uniquely identifies each and every row in a table.



Leave a Reply 0

Your email address will not be published. Required fields are marked *