Database Fundamentals — Question 132
You have a Department table and an Employee table in your database.
You need to ensure that an employee can be assigned to only an existing department.
What should you apply to the Employee table?
Answer options
- A. A primary key
- B. An index
- C. A foreign key
- D. A unique constraint
- E. A data type
Correct answer: C
Explanation
The correct answer is C, a foreign key, because it establishes a relationship between the Employee table and the Department table, ensuring that an employee can only reference a valid department. The other options do not create this relational link; a primary key enforces uniqueness, an index improves search performance, a unique constraint ensures no duplicate values, and a data type defines the nature of the data.