Bird
0
0

Which statement about NULL values in a UNIQUE index is true?

easy📝 Conceptual Q2 of 15
SQL - Indexes and Query Performance
Which statement about NULL values in a UNIQUE index is true?
ANULL values are treated as duplicates in UNIQUE indexes
BNULL values are not allowed in UNIQUE indexes
COnly one NULL is allowed in a UNIQUE index
DMultiple NULLs are allowed in a UNIQUE index
Step-by-Step Solution
Solution:
  1. Step 1: Recall how NULLs behave in UNIQUE indexes

    Most SQL databases allow multiple NULLs in UNIQUE indexes because NULL means unknown, so they are not considered duplicates.
  2. Step 2: Evaluate each option

    Multiple NULLs are allowed in a UNIQUE index correctly states multiple NULLs are allowed; others incorrectly restrict or treat NULLs as duplicates.
  3. Final Answer:

    Multiple NULLs are allowed in a UNIQUE index -> Option D
  4. Quick Check:

    UNIQUE index allows multiple NULLs [OK]
Quick Trick: NULLs are not duplicates, so multiple NULLs allowed [OK]
Common Mistakes:
  • Assuming NULL counts as a duplicate value
  • Believing UNIQUE forbids NULL values
  • Confusing UNIQUE with PRIMARY KEY behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes