Bird
0
0

Which separator is used in the following query?

easy📝 Conceptual Q2 of 15
PostgreSQL - Aggregate Functions and GROUP BY
Which separator is used in the following query?
SELECT STRING_AGG(name, '; ') FROM employees;
ASemicolon and space ("; ")
BComma (",")
CSpace only (" ")
DNo separator
Step-by-Step Solution
Solution:
  1. Step 1: Identify the separator argument in STRING_AGG

    The second argument in STRING_AGG is the separator string; here it is '; ' (semicolon and space).
  2. Step 2: Match the separator to options

    Semicolon and space ("; ") exactly matches the separator '; ' used in the query.
  3. Final Answer:

    Semicolon and space ("; ") -> Option A
  4. Quick Check:

    Separator argument = '; ' [OK]
Quick Trick: Second argument in STRING_AGG is the separator [OK]
Common Mistakes:
  • Assuming default separator is comma if not specified
  • Ignoring spaces in the separator string

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes