Multiple choice technology programming languages

What is a foreign key?

  1. A foreign key is a key field (column) in a database table, which relates the table to another table where the key is a primary key. The primary - foreign key relations are used to cross-reference database tables.

  2. The foreign key is a SQL locking mechanism.

  3. The foreign key is a column that can have NULL values.

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A foreign key is a column (or set of columns) in one table that references the primary key of another table, creating a relationship between the two tables. This referential integrity constraint ensures that data remains consistent across related tables. Option B incorrectly describes it as a locking mechanism.