Bird
0
0

What does the PostgreSQL @> operator do when used with JSONB data?

easy📝 Conceptual Q11 of 15
PostgreSQL - JSON and JSONB

What does the PostgreSQL @> operator do when used with JSONB data?

AChecks if the right JSONB contains the left JSONB
BDeletes the right JSONB from the left JSONB
CMerges two JSONB objects into one
DChecks if the left JSONB contains the right JSONB
Step-by-Step Solution
Solution:
  1. Step 1: Understand the operator's purpose

    The @> operator in PostgreSQL is used to check containment between JSONB values.
  2. Step 2: Identify the direction of containment

    It checks if the JSONB on the left side contains the JSONB on the right side.
  3. Final Answer:

    Checks if the left JSONB contains the right JSONB -> Option D
  4. Quick Check:

    JSONB containment = left contains right [OK]
Quick Trick: Remember: left @> right means left contains right [OK]
Common Mistakes:
  • Confusing which side contains which
  • Thinking it merges JSONB objects
  • Assuming it deletes data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes