NULL and empty text ('') are not the same
Empty text, written '', is a real value: a note box that was filled in with nothing. NULL means no value was recorded at all. They can look alike on screen, but SQL treats them differently. note = '' finds the blank ones, and only IS NULL finds the missing ones — note = NULL finds nothing. Heads up: Oracle stores '' as NULL.
A tiny example
In plain English: Show me the orders whose note was left blank, which is different from having no note at all.
SELECT id, note
FROM orders
WHERE note = '';What comes back
| id | note |
|---|---|
| 103 | |
| 108 |
Orders 103 and 108 have a note that is empty text. Orders whose note is NULL don't come back, because NULL is not equal to ''.
Related SQL lessons
Ready for a break?
Take on today's cozy puzzle. A fresh, bite-sized query waits every morning — no timers, no pressure.
play today's sip