Concept:
A Foreign Key is a field (or set of fields) in one table that refers to the Primary Key of another table. It establishes a relationship between the two tables and helps maintain referential integrity.
• Connects related tables.
• References the Primary Key of another table.
• Prevents invalid or orphan records.
Step 1: Understand Primary Key and Foreign Key.
• Primary Key uniquely identifies each record in a table.
• Foreign Key refers to the Primary Key of another table.
Thus, the relationship between two tables is established using a:
\[
\boxed{\text{Foreign Key}}
\]
Step 2: Example of a Foreign Key.
Suppose there are two tables:
Student Table
{|c|c|}
StudentID (Primary Key) & Name
101 & Rahul
102 & Priya
Marks Table
{|c|c|}
StudentID (Foreign Key) & Marks
101 & 92
102 & 88
Here, StudentID in the Marks table is a Foreign Key because it refers to the Primary Key in the Student table.
Step 3: Analyse the options.
• Foreign Key -- Creates relationships between tables. (Correct)
• Primary Key -- Uniquely identifies records within the same table.
• Unique Key -- Ensures unique values but does not establish relationships.
• Join -- SQL operation used to retrieve data from related tables, not a key.
Step 4: Final conclusion.
Hence, the key used to establish a relationship between two tables is the:
\[
\boxed{\text{Foreign Key}}
\]