skip to main content
Basic elements of SQL : Nulls : Nullability
 

Nullability

Nullability of the resultant column obtained from the CONCAT () function, concat operators (such as ‘+’ or ‘||’), or any other operators (such as ‘+’, ‘-‘, ‘*’, or ‘/’) is calculated based on the nullability of the columns that are being concatenated.
The following truth tables explain the nullability behavior of char and non-char data types.

Char data types

 
Table 3: Nullability Behavior of char Data Types with CONCAT operators (+ or ||) or Scalar String Functions
Column 1
Column 2
Resultant column
(Column 1 (+ or ||) Column 2)
OR
Scalar string function (Column 1, Column 2)
NULLABLE
NULLABLE
NULLABLE
NULLABLE
NON-NULLABLE
NON-NULLABLE
NON-NULLABLE
NULLABLE
NON-NULLABLE
NON-NULLABLE
NON-NULLABLE
NON-NULLABLE
Note: Operators (such as ‘-‘, ‘*’, ‘/’, and so on) are not supported in char data types.

Non-Char data types

 
Table 4: Nullability behavior of non-char Data Types with All the Other Operators
Column 1
Column 2
Column1 (‘+’, ’ –‘, ’*’, and ‘/’) Column2
NULLABLE
NULLABLE
NULLABLE
NULLABLE
NON-NULLABLE
NULLABLE
NON-NULLABLE
NULLABLE
NULLABLE
NON-NULLABLE
NON-NULLABLE
NON-NULLABLE