Bird
0
0

Which statement correctly describes a FOR loop in PostgreSQL?

easy📝 Conceptual Q2 of 15
PostgreSQL - PL/pgSQL Fundamentals
Which statement correctly describes a FOR loop in PostgreSQL?
AIt only runs once and then stops
BIt iterates over a range or query result set automatically
CIt creates a new database schema
DIt deletes rows from a table
Step-by-Step Solution
Solution:
  1. Step 1: Recall FOR loop behavior in PostgreSQL

    A FOR loop automatically iterates over a range of numbers or rows from a query.
  2. Step 2: Match the description with options

    It iterates over a range or query result set automatically correctly states this automatic iteration, unlike other unrelated options.
  3. Final Answer:

    It iterates over a range or query result set automatically -> Option B
  4. Quick Check:

    FOR loop = automatic iteration [OK]
Quick Trick: FOR loops iterate over ranges or query results [OK]
Common Mistakes:
  • Thinking FOR loops run only once
  • Confusing FOR loops with schema creation
  • Assuming FOR loops delete data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes