Microsoft Technology Associate Mta · Free Practice Question Medium
Question 8
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?
-
A
A data type
-
B
A unique constraint
-
C
An index
-
D
A foreign key
-
E
A primary key
Reveal correct answer
Correct answer: D
Explanation
This is an example of a one to many relationship. One employee can be only associated with one department, while a department can have numerous or many employees. To implement this relationship the primary key of table department will be used as a foreign key in table employees. Each department may have zero, one or multiple employees, but an employee can belong to only one department.Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
You must be logged in to post a comment.
