Which of the following is TRUE about Primary Key?

  1. Same value of Primary Key can appear in more than one row in the table

  2. A Primary key defined column can be of type LONG

  3. A column that is defined as Primary Key cannot contain NULL value.

  4. Both A. and B.


Correct Option: C

AI Explanation

To answer this question, you need to understand the concept of a primary key.

A primary key is a column or a set of columns that uniquely identifies each row in a table. It helps maintain data integrity and ensures that there are no duplicate or null values in the primary key column(s).

Let's go through each option to understand why it is correct or incorrect:

Option A) Same value of Primary Key can appear in more than one row in the table - This option is incorrect because a primary key must have unique values for each row in the table. Having the same value of a primary key in more than one row would violate the uniqueness constraint of the primary key.

Option B) A Primary key defined column can be of type LONG - This option is incorrect because a primary key column cannot be of type LONG. The primary key column must have a data type that supports uniqueness and indexing, such as integer, character, or date types.

Option C) A column that is defined as Primary Key cannot contain NULL value - This option is correct. A primary key column cannot contain NULL values. NULL represents the absence of a value, and the primary key must have a value in order to uniquely identify each row in the table. Therefore, a primary key column must have a non-null value.

Option D) Both A. and B. - This option is incorrect because option A is incorrect. The same value of a primary key cannot appear in more than one row in the table.

The correct answer is C) A column that is defined as Primary Key cannot contain NULL value. This option is correct because a primary key column must have a non-null value.

Find more quizzes: