A

Admin • 833K Points
Coach

Q. What is the effect of the FOREIGN KEY constraint?

  • (A) Enforces uniqueness on a column
  • (B) Ensures values in a column match values in a referenced column of another table
  • (C) Automatically indexes the column as UNIQUE
  • (D) Prevents any NULL values
  • Correct Answer - Option(B)
  • Views: 16
  • Filed under category MySQL
  • Hashtags:

Explanation by: Admin

A FOREIGN KEY enforces referential integrity by ensuring the child column values exist in the referenced parent column. It does not by itself enforce uniqueness (the referenced column may be a primary/unique key). It does not automatically prevent NULLs unless specified, nor does it necessarily create a UNIQUE index on the child.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.