The correct answer is D. To return the first non-NULL expression in an argument .
COALESCE evaluates its arguments from left to right and returns the first expression that is not NULL. If all expressions are NULL, it returns NULL.
Why D is correct:
SELECT COALESCE(phone_mobile, phone_home, phone_work, ' No phone ' ) AS contact_phone
FROM customers;
This returns the first available non-NULL phone number. If all phone columns are NULL, it returns ' No phone ' .
Why the other options are incorrect:
A. Splitting strings is handled by functions such as SPLIT.
B. Removing duplicates is handled with DISTINCT, grouping, or deduplication logic.
C. Joining column values is usually done with concatenation functions or operators, such as CONCAT.
Official Snowflake documentation reference:
Snowflake documentation describes COALESCE as a conditional expression that returns the first non-NULL expression among its arguments.
[Reference: Snowflake Documentation — COALESCE; SnowPro Core Study Guide — SQL and Snowflake Objects., ========================]