27.8k views
5 votes
which of the following is true of foreign keys? a.) a foreign key cannot contain null values. b.) a foreign key can only consist of one column. c.) a foreign key cannot be linked to a candidate key. d.) a foreign key is used to enforce referential integrity.

User Jaytea
by
7.7k points

1 Answer

5 votes

Final answer:

A foreign key is a column or a set of columns in a database table that is used to establish a link between two tables and enforce referential integrity. Therefore, the correct answer is d) a foreign key is used to enforce referential integrity.

Step-by-step explanation:

A foreign key is a column or a set of columns in a database table that is used to establish a link between two tables. It is used to enforce referential integrity, which means that it ensures the data in the foreign key column(s) matches the values of the primary key column(s) in the referenced table.

A foreign key can contain null values, so option a) is not true. Option b) is also false because a foreign key can consist of multiple columns. Option c) is incorrect as well, as a foreign key is typically linked to a candidate key in the referenced table to maintain the relationship between the two tables.

Therefore, the correct answer is d) a foreign key is used to enforce referential integrity.

User Roy Truelove
by
7.9k points