3. Using Functions : Step 7

Demo

Convert Nulls to zero.

The function ifnull() will do the job.

SQL

SELECT ename, sal*12 + IFNULL(comm,0) AS "Total salary" FROM emp

Output

ename Total salary
SMITH 9600.00
ALLEN 19500.00
WARD 15500.00
JONES 35700.00
MARTIN 16400.00
BLAKE 34200.00
CLARK 29400.00
SCOTT 36000.00
KING 60000.00
TURNER 18000.00
ADAMS 13200.00
JAMES 11400.00
FORD 36000.00
MILLER 15600.00

Progress

Proceed to Next step