Bird
0
0

Which of the following is a key difference between json and jsonb data types in PostgreSQL?

easy📝 Conceptual Q1 of 15
PostgreSQL - JSON and JSONB
Which of the following is a key difference between json and jsonb data types in PostgreSQL?
A<code>jsonb</code> stores data in a binary format, while <code>json</code> stores it as plain text.
B<code>json</code> supports indexing, but <code>jsonb</code> does not.
C<code>jsonb</code> preserves the original formatting and whitespace, <code>json</code> does not.
D<code>json</code> is faster for querying than <code>jsonb</code>.
Step-by-Step Solution
Solution:
  1. Step 1: Understand storage formats of json and jsonb

    json stores data as plain text, preserving formatting and whitespace. jsonb stores data in a decomposed binary format optimized for processing.
  2. Step 2: Compare indexing and querying capabilities

    jsonb supports indexing and is generally faster for querying, unlike json.
  3. Final Answer:

    jsonb stores data in a binary format, while json stores it as plain text. -> Option A
  4. Quick Check:

    Storage format difference = A [OK]
Quick Trick: Remember: jsonb = binary, json = text [OK]
Common Mistakes:
  • Confusing which type supports indexing
  • Thinking jsonb preserves whitespace
  • Assuming jsonb is slower for queries

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes