Bird
0
0

Identify the error in this SQL snippet:

medium📝 Debug Q14 of 15
SQL - CASE Expressions
Identify the error in this SQL snippet:
SELECT id, NULLIF(bonus) AS result FROM Employees;
AMissing WHERE clause
BNULLIF cannot be used in SELECT clause
CNULLIF requires two arguments, only one given
DNULLIF returns wrong data type
Step-by-Step Solution
Solution:
  1. Step 1: Check NULLIF function usage

    NULLIF requires exactly two arguments, but only one (bonus) is provided here.
  2. Step 2: Validate other options

    NULLIF can be used in SELECT. WHERE clause is optional. NULLIF does not cause data type errors by itself.
  3. Final Answer:

    NULLIF requires two arguments, only one given -> Option C
  4. Quick Check:

    NULLIF needs two values [OK]
Quick Trick: NULLIF always needs two arguments [OK]
Common Mistakes:
  • Using NULLIF with one argument
  • Thinking WHERE clause is mandatory
  • Assuming NULLIF changes data type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes