Bird
0
0

What does a PostgreSQL function declared with RETURNS TABLE do?

easy📝 Conceptual Q11 of 15
PostgreSQL - Advanced PL/pgSQL
What does a PostgreSQL function declared with RETURNS TABLE do?
AReturns no result, only performs actions
BReturns only a single scalar value
CReturns multiple rows and columns as a table result
DReturns a JSON object
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of RETURNS TABLE

    The RETURNS TABLE clause defines that the function will return a set of rows with specified columns, like a table.
  2. Step 2: Compare with other return types

    Unlike scalar returns or void, RETURNS TABLE returns multiple rows and columns.
  3. Final Answer:

    Returns multiple rows and columns as a table result -> Option C
  4. Quick Check:

    RETURNS TABLE means multiple rows/columns [OK]
Quick Trick: RETURNS TABLE means function outputs rows and columns [OK]
Common Mistakes:
  • Thinking RETURNS TABLE returns a single value
  • Confusing RETURNS TABLE with RETURNS VOID
  • Assuming it returns JSON automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes