← Module 05 · Database & SQL
MODULE 05 · DATABASE & SQL

NULL

NULL is a special database marker meaning a value is missing, unknown, or not applicable.

01 · What is it?

NULL means that a value is missing, unknown, or not applicable.

It is not the same thing as zero, an empty string, or the word “NULL”. It represents the absence of a usable value.

Simple definition: NULL says, “There is no known value here.”

02 · Think of it like…

Think of NULL as a blank answer on a form when the answer is not known or does not apply.

ValueMeaning
NULLNo usable value is known or needed.
0The known number is zero.
''The known text is empty.
'NULL'The text literally says “NULL”.
NULLAnswer not known
or not applicable

03 · What does it do?

NULL lets a database record that a field does not currently have a usable value.

Preserves uncertainty

It keeps “unknown” different from a guessed value.

Represents not applicable

It can show that a field does not apply to this record.

Changes comparisons

SQL treats NULL as unknown, so ordinary equality checks do not match it.

04 · Where is it used?

NULL appears in real data whenever information can arrive later, be optional, or not apply.

Optional profile data

A user has not added a phone number or middle name.

Pending workflows

An order has no shipped date because it has not shipped yet.

Missing measurements

A sensor or imported record did not provide a reading.

05 · Example

Finding orders without a shipped date

SELECT order_id, shipped_at
FROM orders
WHERE shipped_at IS NULL;

Use IS NULL to test for NULL. Writing shipped_at = NULL does not work because NULL is not an ordinary value to compare with equals.

06 · How it connects

Input data Validation Database column NULL or known value Query result

A column definition can allow or reject NULL, and queries must use NULL-aware conditions when they need missing records.

07 · Do Not Confuse

NULL

A missing, unknown, or not-applicable value.

Zero

A known numeric value whose amount is 0.

Empty string

A known text value containing no characters.

NULL ≠ 0 ≠ ''. They carry different meanings and can behave differently in queries.

09 · What to Remember

  • NULL means missing, unknown, or not applicable.
  • NULL is different from zero, an empty string, and the text “NULL”.
  • Use IS NULL or IS NOT NULL when filtering for NULL values.
↑