Problem Statement
What does a DEFAULT constraint do during INSERT?
Explanation
DEFAULT supplies a value when the insert omits that column. It does not run if you pass an explicit value, including NULL.
Combine NOT NULL with DEFAULT for robust domain rules.
Code Solution
SolutionRead Only
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
Practice Sets
This question appears in the following practice sets:
