Solution Review: Understanding Nulls
See a detailed analysis of the solution to the "Understanding Nulls" challenge.
We'll cover the following...
Task 1
You were asked to write a query to list the output using the SQL operator is null
for the values true
, false
, and null
.
Solution
The solution for the challenge is given below. Click the “Run” button in the following widget to see the output of the code.
Press + to interact
/***************************************************//***** Write a query to list the output *****//***** using the SQL operator "is null" for *****//***** values true, false, and null. *****//***************************************************/select a::text as val_a,(a is null)::text as "is null"from (values(true),(false),(null)) t1(a);/***************************************************/
Explanation
-
Line 6: ...