Solve “Coalesce null salaries to zero”

Free. Runs in your browser, no install.

SQL · NULL Handling & Data Types

What is NULL?

Easynullis null

Interview question

What is NULL?

How to answer

The short answer

NULL means missing/unknown/not available.

It isn't:

Output
0
''
FALSE

And:

SQL
NULL = NULL

doesn't return TRUE.

Use:

SQL
IS NULL

or:

SQL
IS NOT NULL

Example:

SQL
WHERE manager_id IS NULL

Lock it in with a real drill

You remember an answer longer once you have used it. Try a hands-on problem on this concept.

Open related drill