_______ 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?
- A.
UNIQUE
- B.
NOT NULL
- C.
CHECK
- D.
PRIMARY KEY
Attempted by 1067 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.