_______ is a constraint that can be defined only at the column level?

2023

_______ is a constraint that can be defined only at the column level?

Answer: B. NOT NULLAnswer: B Explanation: In SQL, constraints can be defined at either the column level or the table level. The NOT NULL constraint is applied directly to a…

  1. A.

    UNIQUE

  2. B.

    NOT NULL

  3. C.

    CHECK

  4. D.

    PRIMARY KEY

Attempted by 1265 students.

Show answer & explanation

Correct answer: B

Answer: B Explanation: In SQL, constraints can be defined at either the column level or the table level. The NOT NULL constraint is applied directly to a column and cannot be defined at the table level. It ensures that a column does not accept NULL values. Other constraints like UNIQUE, CHECK, and PRIMARY KEY can be defined at both column and table levels. For example, a PRIMARY KEY can be defined on a single column or multiple columns together. Similarly, UNIQUE and CHECK constraints can be applied across multiple columns in a table. Therefore, NOT NULL is the only constraint that can be defined only at the column level.

Explore the full course: Computer Science

Loading lesson…