which statement(s) does the following If @variable is NULL return '5', else return @variable
-
ISNULL(@variable,'5')
-
NULLIF(@variable,'5')
-
COALESCE(@variable,'5')
-
NONNULL(@variable,'5')
A,C
Correct answer
Explanation
ISNULL(@variable,'5') returns '5' when @variable is NULL, otherwise returns @variable itself. COALESCE(@variable,'5') does the same by returning the first non-NULL value from its arguments. NULLIF returns NULL if two values are equal - the opposite behavior needed here, and NONNULL is not a valid SQL function.