What links a column in one table to the primary key in another and enforces referential integrity?

Study for the DICT Proficiency Diagnostic Test. Prepare with comprehensive resources covering essential topics. Each question has detailed explanations to boost your understanding. Ace your exam with confidence!

The correct choice is a foreign key. A foreign key is a field (or a collection of fields) in one table that uniquely identifies a row of another table or the same table. It establishes a link between the data in the two tables, enabling a relationship that enforces referential integrity. This means that a foreign key in one table must correspond to a valid primary key in the other table, ensuring that relationships between records are consistent and valid.

This integrity constraint helps prevent actions that would leave orphaned records in the database and ensures that any entry in the foreign key field either matches an existing primary key in the related table or is null, thus maintaining the logical link between the two tables.

Other options such as a primary key, index, or generic constraint do not serve this specific purpose of linking tables while enforcing referential integrity between them. A primary key is used to uniquely identify records within its own table, an index improves the speed of data retrieval without enforcing relationships, and constraints can apply to various rules but do not specifically mention linking tables.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy