Which one of the below keys is used to create one-to-many relationship between tables?

  1. Primary
  2. Composite
  3. Foreign
  4. Alternate

The correct answer is Foreign. Here’s why:

  • A foreign key is a column (or combination of columns) in one table that refers to the primary key in another table.  
  • It’s the mechanism that establishes a link between the two tables, specifically a one-to-many relationship.
  • In a one-to-many relationship, one record in the “parent” table (the table with the primary key) can be related to multiple records in the “child” table (the table with the foreign key).

Related Posts

Categories

Tags


PakMCQs.PK Copyright 2024