Logical functions allow you to check conditions and see whether they are true or false. We will take a look at the various categories of logical functions over the coming sections.
Building logical statements
Case statements
Case statements make use of the following syntax: CASE <expression> WHEN <value1> THEN <return1> WHEN <value2> THEN <return2> ... ELSE <default return> END.
In case statements, the value of the expression is matched to each of the values and whenever a match is found, the return value corresponding to it is returned. If no value matches the expression, then the default else value is returned. If there is no default value, null values will be returned.
Case statements...