1. Home
  2. Computer Science MCQs
  3. MySQL
  4. What is the function of the PRIMARY KEY constraint in a…

Added 27 Jan 2024

What is the function of the PRIMARY KEY constraint in a MySQL table?

  1. Uniquely identify each row in the table. Correct answer
  2. Define the order in which data is displayed.
  3. Ensure data integrity by referencing another table.
  4. Limit the number of rows in the table.

Correct answer

A. Uniquely identify each row in the table.

17 views

MCQSEXAM

Explanation

The PRIMARY KEY constraint uniquely identifies each row in a table. Its values must be unique and cannot be NULL, and a table can have only one primary key (which may span several columns).

MySQL automatically builds an index on it. Referencing another table is the role of a FOREIGN KEY.

For more solved questions like this one, see Database Management Systems MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More MySQL MCQs

Practise all MySQL MCQs

Similar MCQs