NOT NULL
A constraint that a column must always hold a value, so NULL is rejected.
In more detail
Declare every column NOT NULL unless an absent value genuinely means something. Pair it with DEFAULT when new rows should start with a known value such as zero.
Related terms
- NULL — SQL's marker for a missing or unknown value, which is not zero, not empty text and not equal to anything, even another NULL.
- constraint — A rule the database enforces on stored data, such as a column that must be unique or not null.
- DEFAULT — A column clause giving the value the database stores when an insert does not supply one.
Taught in
- Forty Terabytes Nobody Opens: Storage And Databases — CompTIA Cloud+ (CV0-004) Exam Prep
- Instrumentation Sprint: Sixteen Calls On Code And Exporters — Prometheus Certified Associate (PCA) Exam Prep
- Why Tables And Relations Beat Files — PostgreSQL, Indexing & Relational Data Modeling
- Keys, Constraints And Referential Integrity — PostgreSQL, Indexing & Relational Data Modeling