Question
What is the difference between a DEFAULT value and a NOT NULL constraint?
Asked by: USER3827
73 Viewed
73 Answers
Answer (73)
A DEFAULT value provides a default value for a column if no value is explicitly provided during insertion. A NOT NULL constraint *requires* a value to be provided during insertion; the default value is irrelevant. If a column has both a DEFAULT and a NOT NULL constraint, the DEFAULT value is used if no value is provided, but the database still enforces that a value must be present.