Back to Browse

WHERE Clause vs NULL: How Three-Valued Logic Works in SQL

152 views
Jul 28, 2025
11:54

In this video, I talk about how NULLs behave in the WHERE clause in SQL — something that trips up a lot of people if it's not properly understood. I walk through an example using a simple products table and explain how NULL can affect the outcome of your queries in ways you might not expect. I also introduce the concept of three-valued logic — true, false, and unknown — which is how SQL evaluates conditions in WHERE and HAVING clauses. You'll see why a query like columnA = NULL doesn't return what you think it should, and what you should do instead. If you've ever been confused by why a row isn't showing up in your results or why comparing NULLs doesn’t work like other values, this video will clear things up. Let me know in the comments if anything’s still unclear or if you want me to cover more on this topic. Instagram: https://www.instagram.com/sql.handbook/

Download

0 formats

No download links available.

WHERE Clause vs NULL: How Three-Valued Logic Works in SQL | NatokHD