AgQuiz #5 – JSON in SQL

This is a regular “data quiz”. Follow it on LinkedIn. Test your knowledge or learn something new.

Today Question:

Which SQL data type stores JSON structures?

A) TEXT 

B) OBJECT 

C) JSON 

D) STRUCT


Correct Answer: C

Explanation

The JSON data type is a relatively new feature of modern SQL databases that allows native storage and processing of JSON (JavaScript Object Notation) documents directly in relational tables. This type combines the flexibility of NoSQL document databases with the advantages of SQL queries. Databases like PostgreSQL, MySQL 5.7+, SQL Server, and Oracle support the JSON type with various functions for parsing, validation, and querying JSON data. The JSON type validates syntax when inserting data and provides optimized storage compared to plain TEXT type. It allows the use of special operators and functions for working with JSON objects, such as extracting values by keys, filtering by nested values, or updating specific parts of a JSON document. This approach is ideal for semi-structured data, configuration files, metadata, or situations where the schema is not rigidly defined but we need to maintain transactional properties of a relational database.