MCQ Single Best Answer Easy

QWhat is the purpose of the FOREIGN KEY constraint in MySQL?

ID: #15422 Introduction to MySQL Databases 102 views
Question Info
#15422Q ID
EasyDifficulty
Introduction to MySQL DatabasesTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A To enforce data integrity rules
  • B To define the primary key of a table
  • C To create an index for faster data retrieval
  • D To specify default values for columns
Correct Answer: Option A

Explanation

The FOREIGN KEY constraint in MySQL is used to establish a relationship between two tables based on a column or a combination of columns. It ensures that the values in the foreign key column(s) match the values in the referenced table's primary key column(s).

Share This Question

Challenge a friend or share with your study group.