Reviewed by Aditya Kumar · Last reviewed 2026-03-24
With nulls in join keys: INNER excludes null keys (no match). LEFT: keeps left rows, null for right when no match or when key is null. RIGHT: mirror of LEFT. Test: create small tables with 0, NULL, 1; run each join; observe. Use COALESCE in ON to normalize: ON...
With nulls in join keys: INNER excludes null keys (no match). LEFT: keeps left rows, null for right when no match or when key is null. RIGHT: mirror of LEFT. Test: create small tables with 0, NULL, 1; run each join; observe. Use COALESCE in ON to normalize: ON COALESCE(a.key,-1)=COALESCE(b.key,-1). 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.