Microsoft Technology Associate Mta · Free Practice Question Easy
Question 11
You have a table named Product that contains the following data.
The PruductID column is the primary key. The CategoryID column is a foreign key to a separate table named Category.
You execute the following statement:
- INSERT INTO Product
- VALUES (3296, 'Table', 4444)
What is the result?
-
A
A new row in the Category table
-
B
A foreign key constraint violation
-
C
A new row in the Product table
-
D
A syntax error
-
E
A primary key constraint violation
Reveal correct answer
Correct answer: E
Explanation
The PRIMARY KEY constraint uniquely identifies each record in a table. Primary keys must contain UNIQUE values, and cannot contain NULL markers. Executing the query will violate the primary key constraint by adding a non-unique value (3296) to a unique column.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
