Multiple choice technology databases

What is the output of the the query: select 'Sql' from dual where null is null;

  1. No rows will be displayed

  2. Sql

  3. It throws Error

  4. None

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The IS NULL operator specifically checks for NULL values. NULL IS NULL evaluates to TRUE in SQL. Since the WHERE condition is TRUE, the query returns 'Sql'. This is the correct way to test for NULL values - you must use IS NULL rather than = NULL.