Skip to main content

NOT NULL & DEFAULT

Learn NOT NULL & DEFAULT (Constraints, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Introduction NOT NULL forbids the absence of a value in a column. DEFAULT supplies a value when an INSERT does not mention the column. Together they define what a valid row looks like when only some columns are provided. MySQL 8.0.13+ also allows expressions as defaults.

More lessons in Constraints