Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. What is three-valued logic?

SQL · NULL Handling & Data Types

What is three-valued logic?

Easysql-29
three-valued logicunknownnull

Question

What is three-valued logic?

Solution

SQL has:

TRUE
FALSE
UNKNOWN

Because NULL represents an unknown value.

So:

NULL = NULL

is UNKNOWN.

It is not TRUE because SQL cannot prove two unknown values are equal.

That shows up in filters:

WHERE column = 10

Rows where column is NULL do not pass, because the comparison is UNKNOWN.

🎯 Put this concept into practice

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

Open related drill →
PreviousNext