Bird
0
0

What does the PostgreSQL operator ->> do when used on a JSON column?

easy📝 Conceptual Q11 of 15
PostgreSQL - JSON and JSONB
What does the PostgreSQL operator ->> do when used on a JSON column?
AConverts the entire JSON object to text
BExtracts the value as JSON from a JSON object by key
CExtracts the value as text from a JSON object by key
DDeletes a key from the JSON object
Step-by-Step Solution
Solution:
  1. Step 1: Understand the ->> operator

    The ->> operator extracts the value of a key from a JSON object and returns it as plain text.
  2. Step 2: Compare with -> operator

    The -> operator returns the value as JSON, not text. So ->> is used when text output is needed.
  3. Final Answer:

    Extracts the value as text from a JSON object by key -> Option C
  4. Quick Check:

    ->> returns text [OK]
Quick Trick: Remember: -> returns JSON, ->> returns text [OK]
Common Mistakes:
  • Confusing -> and ->> operators
  • Thinking ->> returns JSON instead of text
  • Assuming ->> deletes keys

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes