Which function replaces NULL with a specified replacement value in SQL Server?
A
IFNULL() B
COALESCE() C
ISNULL() D
NVL()
Analysis & Theory
ISNULL(expression, replacement) replaces NULL with the replacement value in SQL Server.
Which function returns the first non-NULL value from a list of expressions?
A
NVL() B
COALESCE() C
ISNULL() D
NULLIF()
Analysis & Theory
COALESCE() evaluates arguments in order and returns the first that is not NULL.
What does NVL() do in Oracle SQL?
A
Returns the first non-NULL value from multiple expressions B
Compares two expressions and returns NULL if equal C
Replaces NULL with a specified value D
Checks if a value is NULL
Analysis & Theory
NVL(expression, replacement) replaces NULL with the replacement value in Oracle.
Which function compares two expressions and returns NULL if they are equal?
A
ISNULL() B
COALESCE() C
NULLIF() D
NVL()
Analysis & Theory
NULLIF(expr1, expr2) returns NULL if expr1 = expr2.
What is the result of COALESCE(NULL, NULL, 'Hello')?
A
NULL B
'Hello' C
'NULL' D
Error
Analysis & Theory
COALESCE returns the first non-NULL value, which is 'Hello'.
Which of these functions works the same as ISNULL() in MySQL?
A
NVL() B
IFNULL() C
NULLIF() D
COALESCE()
Analysis & Theory
In MySQL, IFNULL() is used to replace NULL values.
Which function is ANSI standard for replacing NULLs and generally preferred for portability?
A
ISNULL() B
NVL() C
IFNULL() D
COALESCE()
Analysis & Theory
COALESCE() is ANSI SQL standard and works across many databases.
What is the result of NULLIF(5, 5)?
A
5 B
0 C
NULL D
Error
Analysis & Theory
Since 5 = 5, NULLIF returns NULL.
Fill in the blank: To replace NULL salaries with 0 in SQL Server: SELECT ISNULL(Salary, ___) FROM Employees;
A
0 B
NULL C
'0' D
None
Analysis & Theory
ISNULL(Salary, 0) replaces NULL with 0.
True or False: COALESCE() and ISNULL() always behave identically in all databases.
A
True B
False
Analysis & Theory
They have subtle differences; for example, COALESCE can take multiple arguments and may affect data types differently.