Bird
0
0

Which of the following is the correct syntax to close an IF statement in PostgreSQL?

easy📝 Syntax Q12 of 15
PostgreSQL - PL/pgSQL Fundamentals

Which of the following is the correct syntax to close an IF statement in PostgreSQL?

AEND;
BENDIF;
CEND IF;
DFINISH IF;
Step-by-Step Solution
Solution:
  1. Step 1: Recall PostgreSQL block ending syntax

    PostgreSQL requires END IF; to close an IF block explicitly.
  2. Step 2: Compare options

    ENDIF; and FINISH IF; are invalid. END; alone closes other blocks but not IF.
  3. Final Answer:

    END IF; -> Option C
  4. Quick Check:

    Close IF with END IF; [OK]
Quick Trick: Always end IF blocks with END IF; in PostgreSQL [OK]
Common Mistakes:
  • Using END; alone to close IF
  • Writing ENDIF; without space
  • Forgetting to close IF blocks

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes