AppliedAIPrep logoAppliedAI/Prep
🗄️ Data & SQL Engineering
Core

NULLs and Three-Valued Logic

NULL means unknown, so SQL uses three-valued logic where comparisons with NULL return UNKNOWN, not TRUE or FALSE. This is the quiet source of wrong results: = NULL never matches, NOT IN silently drops every row when the subquery contains a NULL, and aggregates and outer joins treat NULL in surprising ways. Applied-AI interviews probe it because confidently wrong queries that pass review are worse than queries that error, and NULL handling is where they hide.

a free account unlocks the core curriculum tier · no card
COURSES COVERING THIS TOPIC

No lesson covers this one directly yet. These teach the surrounding topic from the beginning.

RELATED CONCEPTS
PRACTICE THIS IN REAL QUESTIONS
COMPANIES THAT ASSUME THIS
NEXT IN DATA & SQL ENGINEERINGRanking and Top-N Per Group