Bird
0
0

Which keyword is used to assign a value to a variable in PL/pgSQL?

easy📝 Conceptual Q2 of 15
PostgreSQL - PL/pgSQL Fundamentals
Which keyword is used to assign a value to a variable in PL/pgSQL?
A:=
B=
CSET
DLET
Step-by-Step Solution
Solution:
  1. Step 1: Recall assignment syntax in PL/pgSQL

    PL/pgSQL uses ':=' to assign values to variables.
  2. Step 2: Differentiate from SQL SET

    SET is used for configuration, '=' is for comparisons, LET is not valid in PL/pgSQL.
  3. Final Answer:

    Use ':=' for assignment -> Option A
  4. Quick Check:

    Assignment operator = D [OK]
Quick Trick: Use ':=' to assign values in PL/pgSQL [OK]
Common Mistakes:
  • Using '=' instead of ':=' for assignment
  • Using SET keyword for variable assignment
  • Using LET which is invalid in PL/pgSQL

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes