182k views
3 votes
A referential constraint ensures that?

1) A primary key does not have duplicate values in a table
2) A foreign key value always refers to an existing primary key value in the parent table
3) A many-to-many relationship between two tables
4) Primary key and foreign key columns have identical names

User Ben Cheng
by
7.5k points

1 Answer

4 votes

Final answer:

A foreign key value always refers to an existing primary key value in the parent table

A referential constraint in a database ensures that a foreign key value always refers to an existing primary key value in the parent table, maintaining data integrity.

Step-by-step explanation:

A referential constraint is a rule established between two tables in a relational database. It ensures that a foreign key value always refers to an existing primary key value in the parent table.

This relationship helps to maintain data integrity by ensuring that there cannot be a reference to a non-existent primary key, thus preventing orphaned records in the child table.

A referential constraint ensures that a foreign key value always refers to an existing primary key value in the parent table.

A referential constraint ensures that:

A foreign key value always refers to an existing primary key value in the parent table

A referential constraint, often implemented using foreign key relationships, ensures that values in a column (foreign key) of one table correspond to the values in the primary key column of another table (parent table).

This maintains the integrity of the relationship between the tables and enforces the rule that a foreign key value must always reference an existing primary key value in the referenced table.

This helps maintain consistency and avoids orphaned or invalid references in the database.

User Pteromys
by
7.0k points