SQLCOALESCENULLtutorial

What is COALESCE in SQL? Handling NULL for beginners

COALESCE returns the first non-NULL value from a list. Plain words: defaults for missing data, fallback chains (nickname → name → 'Guest'), safe arithmetic, and pairing with NULLIF. With tables and common pitfalls.

1 min readSQL · COALESCE · NULL · tutorial

COALESCE returns the first non-NULL value from a list of arguments. Essentially a fallback chain: if the first is NULL, take the second; if that's NULL too, the third; and so on.

This article is currently in Russian. The full English translation is on the way.

Practice on real tasks

Solve tasks in the SQL trainer with instant grading and hints.

Open trainer