Reviewed by Aditya Kumar · Last reviewed 2026-03-24
NULL in joins: NULL = NULL is UNKNOWN, so INNER JOIN excludes null keys. LEFT JOIN: left rows with null key get null for right side. With 0, NULL, 1: INNER on 0 and 1 only; NULL never matches. LEFT: all left rows; right null for no match. Be explicit with COALESCE in join keys...
NULL in joins: NULL = NULL is UNKNOWN, so INNER JOIN excludes null keys. LEFT JOIN: left rows with null key get null for right side. With 0, NULL, 1: INNER on 0 and 1 only; NULL never matches. LEFT: all left rows; right null for no match. Be explicit with COALESCE in join keys if nulls should match. Why it matters: Design choices compound at scale—wrong approach can cause 100× overhead. Scalability trade-offs: Profile before optimizing; validate on sample then full. Cost implications: Suboptimal choices multiply at billion-row scale.
Red Flag: Using null keys in joins without explicit handling—NULL=NULL is UNKNOWN. Pro-Move: 'We normalized with COALESCE(key,-1) in join; documented null semantics in data contract.'
According to DataEngPrep.tech, this is one of the most frequently asked SQL interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.