NULL marks a value that is missing: nothing has been recorded. It is not zero and it is not an empty piece of text. Those are values; NULL is the absence of one.
In the Invoices table of the example database, PaidDate is NULL for the two invoices that have not been paid yet:
| InvoiceID | Supplier | Amount | PaidDate |
|---|---|---|---|
| 1001 | Hartwell Lighting | 24,600.00 | 2025-04-01 |
| 1002 | Kestrel Catering | 3,180.00 | 2025-03-28 |
| 1003 | Ashby Camera Hire | 41,250.00 | |
| 1004 | Kestrel Catering | 2,940.00 |
Why = does not work
Section titled “Why = does not work”A comparison with NULL is never true. PaidDate = NULL does not mean “has no paid date”; it asks whether the paid date equals an unknown value, and the answer to that is unknown too. So this query returns no rows at all:
SELECT InvoiceID FROM InvoicesWHERE PaidDate = NULL;The same goes for <>, < and the other comparison operators.
IS NULL
Section titled “IS NULL”IS NULL is the test for a missing value. To find the unpaid invoices:
SELECT InvoiceID, Supplier, AmountFROM InvoicesWHERE PaidDate IS NULL;| InvoiceID | Supplier | Amount |
|---|---|---|
| 1003 | Ashby Camera Hire | 41,250.00 |
| 1004 | Kestrel Catering | 2,940.00 |
IS NOT NULL
Section titled “IS NOT NULL”IS NOT NULL finds the rows that do have a value. To find the paid invoices:
SELECT InvoiceID, Supplier, PaidDateFROM InvoicesWHERE PaidDate IS NOT NULL;| InvoiceID | Supplier | PaidDate |
|---|---|---|
| 1001 | Hartwell Lighting | 2025-04-01 |
| 1002 | Kestrel Catering | 2025-03-28 |
To show a stand-in value where a column is NULL, such as “unpaid”, see SQL Null Functions.