Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. What happens when NULL is added to a number?

SQL · NULL Handling & Data Types

What happens when NULL is added to a number?

Easysql-28
nullarithmetic

Question

What happens when NULL is added to a number?

Solution

Usually:

10 + NULL

produces:

NULL

because the result is unknown.

Similarly, string concatenation involving NULL is dialect-dependent. Some systems propagate NULL, while others/functions may treat it differently.

For portable logic, explicitly handle it:

COALESCE(name, '')

🎯 Put this concept into practice

Solidify this answer with real hands-on interview drills in the browser studio.

Open related drill →
PreviousNext