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:

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.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need