Bird
0
0

Which operator would you use to extract the value of a JSON key as plain text in PostgreSQL?

easy📝 Conceptual Q2 of 15
PostgreSQL - JSON and JSONB
Which operator would you use to extract the value of a JSON key as plain text in PostgreSQL?
A#>
B->
C->>
D#>>
Step-by-Step Solution
Solution:
  1. Step 1: Identify operator for text extraction

    The ->> operator extracts the JSON field value as plain text.
  2. Step 2: Differentiate from similar operators

    The -> operator returns JSON, while #> and #>> are for JSON path extraction, not simple key extraction.
  3. Final Answer:

    ->> -> Option C
  4. Quick Check:

    ->> operator = Extract JSON field as text [OK]
Quick Trick: Use ->> to get JSON key value as text [OK]
Common Mistakes:
  • Using -> instead of ->> for text extraction
  • Confusing #> and ->>
  • Assuming ->> returns JSON

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes