Reviewed by Aditya Kumar · Last reviewed 2026-03-24
**COALESCE(v1, v2, ..., vN):** Returns first non-NULL. Standard SQL. Use for: defaults, merging columns, full outer join keys. **vs ISNULL:** COALESCE takes N args; ISNULL takes 2. COALESCE is portable....
COALESCE(v1, v2, ..., vN): Returns first non-NULL. Standard SQL. Use for: defaults, merging columns, full outer join keys.
vs ISNULL: COALESCE takes N args; ISNULL takes 2. COALESCE is portable.
SELECT COALESCE(phone, email, 'N/A') AS contact
SELECT COALESCE(a.id, b.id) -- full outer join key
-- Spark: coalesce(col1, col2, lit('default'))
Red Flag: ISNULL when multiple fallbacks needed. Pro-Move: 'COALESCE for chain of fallbacks—we use for contact info: phone → email → N/A.'
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.