Complete the code to select rows where column_a is distinct from column_b, including NULL-safe comparison.
SELECT * FROM table_name WHERE column_a [1] column_b;The IS DISTINCT FROM operator compares two values and treats NULLs as distinct values, unlike the standard = operator.
Complete the code to select rows where column_a is NOT distinct from column_b, including NULL-safe comparison.
SELECT * FROM table_name WHERE column_a [1] column_b;The IS NOT DISTINCT FROM operator returns true when values are equal or both NULL, providing NULL-safe equality comparison.
Fix the error in the WHERE clause to correctly compare column_a and column_b with NULL-safe comparison.
SELECT * FROM table_name WHERE column_a [1] column_b;Using IS DISTINCT FROM ensures NULL-safe comparison, unlike '=' which returns NULL if either side is NULL.
Fill both blanks to select rows where column_x is distinct from column_y and column_z is NOT distinct from column_w.
SELECT * FROM table_name WHERE column_x [1] column_y AND column_z [2] column_w;
The first blank uses IS DISTINCT FROM to find rows where column_x and column_y differ including NULLs. The second blank uses IS NOT DISTINCT FROM to find rows where column_z and column_w are equal or both NULL.
Fill all three blanks to select rows where column_a is distinct from column_b, column_c is NOT distinct from column_d, and column_e is distinct from NULL.
SELECT * FROM table_name WHERE column_a [1] column_b AND column_c [2] column_d AND column_e [3] NULL;
The first blank uses IS DISTINCT FROM to compare column_a and column_b safely. The second blank uses IS NOT DISTINCT FROM for column_c and column_d. The third blank uses IS DISTINCT FROM to compare column_e with NULL safely.