NULL
Also called: NULL value
A database marker for "no value" or "unknown". It's not zero and not an empty string.
Definition
NULL behaves differently from normal values: nothing is equal to NULL (not even NULL), so you must write IS NULL or IS NOT NULL. Conditions like city <> 'Berlin' also skip rows where city is NULL, a common source of wrong counts.
In practice
WHERE coupon_id = NULL returns zero rows without any error. WHERE coupon_id IS NULL returns the orders placed without a coupon.
Learn it in context
Lessons that use this term.
Related terms
- Table (database)A set of rows and columns in a database that holds one kind of thing, like users or orders.
- SQLThe language used to read and change data in relational databases, like SELECT * FROM orders.
- JOIN (SQL)Combining rows from two tables that belong together, for example each order with its customer.