Loading lesson...
NULL: the billion dollar mistake
NULL: the billion dollar mistake
Topics covered: NULL vs zero vs empty string, Three-Valued Logic, IS NULL and IS NOT NULL operators, COUNT(*) vs COUNT(column), Aggregates with NULLs
Understanding NULL These three concepts are often confused, but they represent completely different things: Purpose of NULL
Three-Valued Logic This is why the following comparisons don't work as you might expect: WHERE Clause Behavior IS NULL vs = NULL
Basic NULL Checks IS NOT NULL Common Mistakes This is one of the most common SQL mistakes:
COUNT Behaviors COUNT Behaviors
Other Aggregate Behaviors MIN/MAX Skip NULLs All NULLs: Special Case This quickly shows how complete your data is for different columns. Incomplete Records Finding records with missing data is essential for data quality monitoring. This finds pending orders that can't ship because they're missing an address. Finding Missing Data