Bird
0
0

Given the JSON column info with value '{"user": {"name": "Bob", "age": 25}}', what is the result of SELECT info #>> '{user,name}'?

medium📝 query result Q4 of 15
PostgreSQL - JSON and JSONB
Given the JSON column info with value '{"user": {"name": "Bob", "age": 25}}', what is the result of SELECT info #>> '{user,name}'?
A"Bob"
BBob
C{ "name": "Bob" }
DNULL
Step-by-Step Solution
Solution:
  1. Step 1: Understand #>> operator

    #>> extracts text value at the given path, so it returns the string without quotes.
  2. Step 2: Apply to given JSON

    At path {user,name}, the value is "Bob". Extracting text returns Bob without quotes.
  3. Final Answer:

    Bob -> Option B
  4. Quick Check:

    #>> returns text without quotes = Bob [OK]
Quick Trick: Text extraction returns unquoted string [OK]
Common Mistakes:
  • Expecting quotes around text
  • Confusing JSON extraction with text extraction
  • Assuming NULL for existing keys

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes