Skip to main contentSkip to solution

Which of the following constraints cannot take NULL values?

Solution

✅ Correct Option: 2

The primary key uniquely identifies each row, so it can never be NULL. This is the entity integrity rule: no attribute of a primary key may hold a NULL value.


Foreign key: it can be NULL when a row has no related row in the parent table, and it only needs to match a parent key value when it is not NULL.

Candidate key and Super key: these only need to identify rows uniquely. In SQL, columns declared UNIQUE can hold NULL, and only the candidate key chosen as the primary key gets the NOT NULL restriction.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question