SQL Conditional Functions such as CASE, COALESCE, NULLIF, and DECODE allow you to implement IF-ELSE logic, handle null values, and perform conditional evaluations directly within SQL queries.
Time limit: 0
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Which of the following can be replaced by a simple CASE expression?
Correct
Incorrect
Question 4 of 15
4. Question
What does NULLIF(100, 100) return?
Correct
Incorrect
Question 5 of 15
5. Question
What is the output of COALESCE(NULL, NULL, NULL)?
Correct
Incorrect
Question 6 of 15
6. Question
Which SQL function returns NULL only when two values are equal?
Correct
Incorrect
Question 7 of 15
7. Question
What is the output of this CASE expression?
CASE WHEN 2 > 3 THEN ‘Yes’ ELSE ‘No’ END
Correct
Incorrect
Question 8 of 15
8. Question
What is the purpose of Oracle’s DECODE() function?
Correct
Incorrect
Question 9 of 15
9. Question
Which function is Oracle-specific and not ANSI-standard?
Correct
Incorrect
Question 10 of 15
10. Question
What is the return value of this expression:
CASE WHEN salary > 50000 THEN ‘High’ ELSE ‘Low’ END when salary = 60000?
Correct
Incorrect
Question 11 of 15
11. Question
What is the key difference between COALESCE() and IFNULL()?
Correct
Incorrect
Question 12 of 15
12. Question
What is the result of DECODE(1, 1, ‘A’, 2, ‘B’, ‘C’) in Oracle?
Correct
Incorrect
Question 13 of 15
13. Question
Which function should you use to avoid division by zero?
Correct
Incorrect
Question 14 of 15
14. Question
What does CASE WHEN NULL THEN ‘Yes’ ELSE ‘No’ END return?
Correct
Incorrect
Question 15 of 15
15. Question
Which function can replace nested IF statements elegantly?
Correct
Incorrect
Summary
SQL Conditional Functions like CASE, COALESCE, NULLIF, and DECODE are powerful tools for implementing decision logic, handling NULLs, and customizing query output. Understanding these helps write more readable and robust SQL queries across platforms like Oracle, MySQL, PostgreSQL, and SQL Server.
At QuizOrbit, our team specializes in fun, informative quizzes across topics like general knowledge, technology, and entertainment. Boost your knowledge with our expert-designed quizzes.