Bird
0
0

What restriction does the UNIQUE constraint impose on a column in a SQL table?

easy📝 Conceptual Q1 of 15
SQL - Table Constraints
What restriction does the UNIQUE constraint impose on a column in a SQL table?
AIt automatically indexes the column as a primary key.
BIt allows only NULL values in that column.
CIt prevents duplicate values in that column.
DIt restricts the column to numeric values only.
Step-by-Step Solution
Solution:
  1. Step 1: Understand UNIQUE constraint

    The UNIQUE constraint ensures that all values in a column are distinct.
  2. Step 2: Analyze options

    It prevents duplicate values in that column. correctly states this. It allows only NULL values in that column. is incorrect because UNIQUE allows multiple NULLs in many DBMS. It automatically indexes the column as a primary key. is wrong because UNIQUE is not the same as PRIMARY KEY. It restricts the column to numeric values only. is unrelated.
  3. Final Answer:

    It prevents duplicate values in that column. -> Option C
  4. Quick Check:

    UNIQUE means no duplicates allowed [OK]
Quick Trick: UNIQUE means no duplicate values allowed [OK]
Common Mistakes:
MISTAKES
  • Confusing UNIQUE with PRIMARY KEY
  • Assuming UNIQUE disallows NULLs
  • Thinking UNIQUE restricts data type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes