CONTROL FLOW FUNCTIONS

IF(expr1,expr2,expr3) :

If expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns expr2; otherwise it returns expr3. IF() returns a numeric or string value, depending on the context in which it is used.

example 1 :
SELECT id,IF(gen='m','Male','Female') AS gen FROM gender;
IFNULL(expr1,expr2) :

If expr1 is not NULL, IFNULL() returns expr1; otherwise it returns expr2. IFNULL() returns a numeric or string value, depending on the context in which it is used.

example 2 :
SELECT id,IFNULL(name,'N/A') AS name FROM test;