Bird
0
0

What does the STRING_AGG function do in PostgreSQL?

easy📝 Conceptual Q11 of 15
PostgreSQL - Aggregate Functions and GROUP BY
What does the STRING_AGG function do in PostgreSQL?
AIt combines multiple text values into one string with a separator.
BIt counts the number of rows in a table.
CIt sorts rows based on a column.
DIt deletes duplicate rows from a table.
Step-by-Step Solution
Solution:
  1. Step 1: Understand STRING_AGG purpose

    STRING_AGG is used to join multiple text values into a single string with a separator.
  2. Step 2: Compare with other options

    Counting rows, sorting, or deleting duplicates are different functions, not STRING_AGG.
  3. Final Answer:

    It combines multiple text values into one string with a separator. -> Option A
  4. Quick Check:

    STRING_AGG joins text values = It combines multiple text values into one string with a separator. [OK]
Quick Trick: Remember: STRING_AGG joins strings with a separator [OK]
Common Mistakes:
  • Confusing STRING_AGG with COUNT or ORDER BY
  • Thinking STRING_AGG sorts rows
  • Assuming STRING_AGG removes duplicates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes