NULL Handling · Question 20 · Hard

In SQL's three-valued logic, which of these expressions evaluates to FALSE (not to UNKNOWN)?

  1. NULL AND TRUE
  2. NULL OR FALSE
  3. NULL AND FALSE
  4. NOT (NULL = NULL)
Answer and explanation

Answer: C. NULL AND FALSE

Explanation: AND is FALSE as soon as one side is FALSE, whatever the unknown side might be, so NULL AND FALSE is FALSE. NULL AND TRUE and NULL OR FALSE depend on the unknown value and stay UNKNOWN, and NOT of UNKNOWN is UNKNOWN.

Previous: Table Parcel: id | city | agent 1 | Pune | Ravi 2 | Pune | NULL 3 | Indore |…

Practise null handling

Try a fresh set of null handling questions with an explanation after every answer, free and without signing up: NULL Handling practice. Or sit a full placement mock test.

More null handling questions

More sql practice

SQL Functions & CASE · UNION, INTERSECT & EXCEPT · Tables, Keys & Constraints · DML & Transactions · SELECT, WHERE & ORDER BY · SQL Joins · Aggregates & GROUP BY · Subqueries & CTEs

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge