In a database, what does a 'foreign key' do?

Practice Questions

Q1
In a database, what does a 'foreign key' do?
  1. Links two tables together
  2. Identifies a unique record
  3. Stores large amounts of data
  4. Indexes a table for faster access

Questions & Step-by-Step Solutions

In a database, what does a 'foreign key' do?
Correct Answer: A foreign key links two tables together by referencing the primary key of another table.
  • Step 1: Understand that a database is like a collection of tables that store information.
  • Step 2: Know that each table can have a 'primary key', which is a unique identifier for each record in that table.
  • Step 3: A 'foreign key' is a special column in one table that refers to the primary key of another table.
  • Step 4: This connection allows you to link related data from different tables together.
  • Step 5: For example, if you have a 'Customers' table and an 'Orders' table, the 'Orders' table can have a foreign key that links to the 'Customers' table to show which customer made each order.
No concepts available.
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely