Which two statements are true about constraints? (Choose two.)

  1. The UNIQUE constraint does not permit a null value for the column.

  2. A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.

  3. The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index

  4. The NOT NULL constraint ensures that null values are not permitted for the column


Correct Option: B,D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) The UNIQUE constraint does not permit a null value for the column. This option is incorrect because the UNIQUE constraint does allow null values for the column. However, it enforces uniqueness among the non-null values in the column.

Option B) A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints. This option is correct. When a column has a PRIMARY KEY or UNIQUE constraint, a UNIQUE index is automatically created for that column. This index ensures that the values in the column are unique.

Option C) The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index. This option is incorrect. While the PRIMARY KEY constraint does create a UNIQUE index, the FOREIGN KEY constraint does not create a UNIQUE index. The FOREIGN KEY constraint establishes a relationship between two tables.

Option D) The NOT NULL constraint ensures that null values are not permitted for the column. This option is correct. The NOT NULL constraint is used to ensure that a column does not contain any null values. It requires that every value in the column must be non-null.

The correct answers are B and D. These options are correct because a UNIQUE index is created for columns with PRIMARY KEY and UNIQUE constraints, and the NOT NULL constraint ensures that null values are not permitted for the column.

Find more quizzes: