FUNCTIONS NULL

If we change a NULL for that value, use the following functions (ISNULL, IFNULL, NVL, COLACESCE) according to the system database.

For our examples, we want if the value is NULL is changed by the value 0

Example of SQL SERVER using ISNULL:

SELECT product, UnitPrice * (unitsinstock + ISNULL (unitsordered, 0) FROM products

Example for using ORACLE NVL:

SELECT product, UnitPrice * (unitsinstock + NVL (unitsordered, 0) FROM products

Example for MySQL, there are 2 equivalent functions (IFNULL, COALESCE):

SELECT product, UnitPrice * (unitsinstock + IFNULL (unitsordered, 0) FROM products

SELECT product, UnitPrice * (unitsinstock + COALESCE (unitsordered, 0) FROM products