Skip to main contentSkip to solution

What are the common SQL Constraints?

(A) SUPER KEY

(B) CANDIDATE KEY

(C) UNIQUE

(D) DEFAULT

Solution

✅ Correct Option: 3

UNIQUE and DEFAULT are both SQL constraints. UNIQUE makes sure all values in a column are different, and DEFAULT assigns a preset value when none is given.

The common SQL constraints are NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK and DEFAULT.


Super key and candidate key: these are concepts from relational database design, not SQL constraint keywords. In SQL, a candidate key is actually enforced using UNIQUE or PRIMARY KEY, which is why they are easy to mistake for constraints.

Keyboard Shortcuts

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