Which statement best describes a unique constraint in terms of nullability?

Prepare for the TJR Bootcamp Test with quizzes and flashcards. Each question includes hints and explanations to boost your readiness for the exam!

Multiple Choice

Which statement best describes a unique constraint in terms of nullability?

A unique constraint makes sure the values in the constrained column (or set of columns) are all different. How it treats nulls is separate: NULL is considered an unknown value, and in practice many databases don’t count NULLs as duplicates. So a column with a unique constraint can still allow NULLs, but exactly how NULLs are handled can vary by database. If you want to forbid NULLs entirely, you’d add NOT NULL (or use a primary key, which implies NOT NULL).

That’s why this option is the best: it captures both the uniqueness requirement and the variable behavior of NULLs across systems. The other statements misstate the effect of a unique constraint on nulls: it doesn’t automatically disallow NULLs in all systems, it doesn’t make the column a primary key, and it doesn’t always prevent NULL values.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy