Bird
0
0

Identify the error in this SQL procedure snippet:

medium📝 Debug Q14 of 15
SQL - Stored Procedures and Functions
Identify the error in this SQL procedure snippet:
IF score > 50
  SELECT 'Pass';
ELSE
  SELECT 'Fail';
END IF;
AMissing semicolon after ELSE
BMissing BEGIN keyword
CIncorrect END IF syntax
DMissing THEN after IF condition
Step-by-Step Solution
Solution:
  1. Step 1: Check IF statement syntax

    In SQL procedures, IF must be followed by THEN after the condition.
  2. Step 2: Verify given code

    The code has IF score > 50 but no THEN keyword.
  3. Final Answer:

    Missing THEN after IF condition -> Option D
  4. Quick Check:

    IF condition THEN is required [OK]
Quick Trick: Always put THEN after IF condition [OK]
Common Mistakes:
  • Omitting THEN after IF
  • Adding semicolon after ELSE incorrectly
  • Misusing END IF syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes