Bird
0
0

Identify the error in this PL/pgSQL snippet:

medium📝 Debug Q6 of 15
PostgreSQL - PL/pgSQL Fundamentals
Identify the error in this PL/pgSQL snippet:
BEGIN
  RAISE WARNIN 'Low disk space';
  RAISE NOTICE 'Continuing process';
END;
ARAISE WARNING is misspelled
BRAISE NOTICE cannot follow RAISE WARNING
CMissing semicolon after RAISE WARNING
DRAISE statements must be inside a function
Step-by-Step Solution
Solution:
  1. Step 1: Check spelling of RAISE levels

    The correct keyword is RAISE WARNING, but here it is written as RAISE WARNIN (missing 'G').
  2. Step 2: Validate syntax rules

    RAISE NOTICE can follow RAISE WARNING; semicolons are present; RAISE can be used in DO blocks or functions.
  3. Final Answer:

    RAISE WARNING is misspelled -> Option A
  4. Quick Check:

    Spelling errors cause syntax errors [OK]
Quick Trick: Check spelling of RAISE levels carefully [OK]
Common Mistakes:
  • Misspelling RAISE WARNING as WARNIN
  • Assuming RAISE NOTICE cannot follow WARNING
  • Forgetting semicolons

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes