Tag: JSON

Convert structured data to JSON for language model processing (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Implement AI capabilities in database solutions (25–30%)
   --> Design and implement retrieval-augmented generation (RAG)
      --> Convert structured data to JSON for language model processing


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

Modern AI-enabled database applications frequently need to send structured data stored in relational tables to Large Language Models (LLMs). Because LLMs interact with text or structured payloads such as JSON rather than relational tables, developers must transform SQL query results into JSON before sending them to AI services.

For the DP-800 exam, you should understand how to convert relational data into JSON using SQL, why JSON is the preferred interchange format for AI services, how JSON is used in Retrieval-Augmented Generation (RAG) workflows, and the best practices for preparing structured data for language model processing.


Why Convert Structured Data to JSON?

Relational databases organize information into:

  • Tables
  • Rows
  • Columns
  • Relationships

Large Language Models, however, consume:

  • Natural language
  • JSON documents
  • API payloads
  • Structured text

JSON (JavaScript Object Notation) provides a lightweight, hierarchical format that is easy for applications, APIs, and AI models to process.

Instead of sending an entire table, developers typically send only the relevant records formatted as JSON.


Role of JSON in AI Applications

JSON serves as the common data exchange format between SQL databases and AI services.

Typical workflow:

SQL Database
Query Structured Data
Convert to JSON
Build AI Prompt
REST API Request
Large Language Model
AI Response

This process allows structured business data to become part of an AI prompt or API request.


What Is JSON?

JSON is a text-based format consisting of key-value pairs and arrays.

Example:

{
"CustomerID": 1001,
"CustomerName": "Contoso Ltd.",
"Country": "USA",
"CreditLimit": 50000
}

Nested objects are also supported.

Example:

{
"OrderID": 1055,
"Customer": {
"Name": "Contoso Ltd.",
"Country": "USA"
}
}

Hierarchical structures like these are easier for language models to interpret than tabular data.


Why AI Models Prefer JSON

JSON provides several advantages:

  • Human-readable
  • Machine-readable
  • Structured
  • Flexible
  • Widely supported
  • Easily serialized
  • Easily parsed

Most AI REST APIs accept JSON request bodies and return JSON responses.


Converting SQL Query Results to JSON

Modern SQL platforms support generating JSON directly from query results.

For example, SQL Server and Azure SQL Database provide the FOR JSON clause.

Example:

SELECT CustomerID,
CustomerName,
Country
FROM Customers
FOR JSON AUTO;

Sample output:

[
{
"CustomerID":1001,
"CustomerName":"Contoso Ltd.",
"Country":"USA"
},
{
"CustomerID":1002,
"CustomerName":"Fabrikam",
"Country":"Canada"
}
]

This JSON can be incorporated into prompts or REST API requests.


FOR JSON AUTO

FOR JSON AUTO automatically generates JSON based on the structure of the SELECT statement.

Advantages:

  • Minimal configuration
  • Quick generation
  • Good for simple queries

Example:

SELECT ProductID,
ProductName,
Price
FROM Products
FOR JSON AUTO;

FOR JSON PATH

FOR JSON PATH provides greater control over the resulting JSON structure.

Example:

SELECT
CustomerID AS 'Customer.ID',
CustomerName AS 'Customer.Name'
FOR JSON PATH;

Output:

[
{
"Customer": {
"ID":1001,
"Name":"Contoso Ltd."
}
}
]

FOR JSON PATH is preferred when a specific JSON schema is required by an application or AI service.


Creating Nested JSON

Nested JSON is useful for representing parent-child relationships.

Example:

Customer

Orders

Order Items

Instead of returning multiple unrelated tables, developers can build a hierarchical JSON document that mirrors the business object.

This format is often easier for an LLM to understand.


Using JSON in Prompts

Rather than embedding raw SQL results, developers can include JSON as structured context.

Example prompt:

Use the following customer information:
{
"CustomerID":1001,
"Name":"Contoso Ltd.",
"Country":"USA",
"CreditLimit":50000
}
Summarize the customer's profile.

The structured format enables the model to identify fields and values more reliably.


JSON in Retrieval-Augmented Generation (RAG)

In RAG applications, retrieved information often comes from:

  • SQL queries
  • Vector search
  • Hybrid search
  • APIs

Structured query results can be converted to JSON before being added to the prompt.

Workflow:

SQL Query
FOR JSON
Prompt Construction
LLM
Grounded Response

Combining Structured and Unstructured Data

Many AI applications combine relational data with documents.

Example:

Structured data:

{
"OrderID":1055,
"Status":"Shipped"
}

Retrieved documentation:

Orders typically arrive within three business days after shipment.

Prompt:

Order Information:
{
"OrderID":1055,
"Status":"Shipped"
}
Documentation:
Orders typically arrive within three business days.
Answer the customer's question.

This approach gives the LLM access to both factual business data and supporting context.


Reducing Token Usage

Large JSON payloads increase:

  • Prompt size
  • Latency
  • API cost
  • Token consumption

Best practice:

Include only relevant fields.

Instead of:

{
"CustomerID":1001,
"Name":"Contoso",
"Country":"USA",
"Phone":"...",
"Fax":"...",
"CreatedDate":"...",
"LastLogin":"...",
...
}

Use:

{
"CustomerID":1001,
"Country":"USA",
"CreditLimit":50000
}

Only include information required to answer the user’s question.


Security Considerations

Before converting SQL data to JSON:

  • Remove sensitive columns.
  • Exclude personally identifiable information (PII) unless required and authorized.
  • Apply row-level security (RLS).
  • Enforce column-level permissions.
  • Mask confidential values when appropriate.
  • Validate user authorization before retrieving data.

AI models should receive only the data necessary to perform the requested task.


Data Quality Considerations

Language model responses are only as good as the input data.

Ensure that:

  • Missing values are handled appropriately.
  • Duplicate rows are removed.
  • Invalid records are excluded.
  • Data types are consistent.
  • Field names are meaningful.
  • JSON is well-formed and valid.

Poor-quality JSON often leads to inaccurate or confusing AI responses.


Processing AI Responses

Most AI services also return JSON.

Example:

{
"summary":
"Contoso Ltd. is a U.S. customer with a credit limit of $50,000."
}

SQL JSON functions such as:

  • JSON_VALUE
  • JSON_QUERY
  • OPENJSON

can extract values from the response for further processing or storage.


Common Mistakes

Sending Entire Tables

Avoid sending unnecessary rows.

Instead:

Retrieve only relevant records.


Including Too Many Columns

Large prompts increase token usage and cost.


Using Poor Field Names

Prefer:

CustomerName

instead of:

C_Name

Clear field names help improve model understanding.


Ignoring Security

Never expose confidential information unnecessarily.


Creating Invalid JSON

Malformed JSON causes REST API failures and prevents AI services from processing requests.


Best Practices

  • Use FOR JSON AUTO for simple JSON generation.
  • Use FOR JSON PATH when custom JSON structures are required.
  • Return only relevant rows and columns.
  • Keep JSON concise to reduce token consumption.
  • Use meaningful field names.
  • Remove confidential or unnecessary information.
  • Validate JSON before sending it to AI services.
  • Combine structured JSON with retrieved documents for RAG scenarios.
  • Parse AI responses using SQL JSON functions.
  • Test prompts using realistic business data.

DP-800 Exam Tips

Remember these key points for the exam:

  • JSON is the standard format for exchanging structured data with AI services.
  • SQL Server and Azure SQL Database support JSON generation using FOR JSON.
  • FOR JSON AUTO automatically formats query results.
  • FOR JSON PATH provides greater control over JSON structure.
  • RAG solutions often include JSON generated from SQL queries as contextual information.
  • Smaller, focused JSON payloads reduce token usage and improve performance.
  • Protect sensitive information before converting data to JSON.
  • SQL JSON functions can parse AI responses returned as JSON.

Practice Exam Questions

Question 1

A database developer needs to send customer records from SQL Server to a Large Language Model through a REST API.

Which format is most appropriate?

A. XML

B. CSV

C. JSON

D. Binary data

Answer: C

Explanation:
JSON is the standard format accepted by most AI REST APIs because it is lightweight, structured, and easy for both applications and language models to process.


Question 2

Which SQL clause automatically converts query results into JSON using the default structure of the SELECT statement?

A. FOR JSON AUTO

B. FOR XML

C. OPENJSON

D. JSON_VALUE

Answer: A

Explanation:
FOR JSON AUTO automatically generates JSON based on the query structure with minimal configuration.


Question 3

A developer needs complete control over the hierarchy and property names in the generated JSON document.

Which SQL feature should be used?

A. FOR XML

B. FOR JSON PATH

C. JSON_QUERY

D. OPENJSON

Answer: B

Explanation:
FOR JSON PATH allows developers to customize the JSON structure, including nested objects and property names.


Question 4

Why is JSON commonly used when interacting with Large Language Models?

A. It permanently stores embeddings.

B. It replaces vector indexes.

C. It provides a structured, machine-readable format that AI services commonly accept.

D. It automatically encrypts database records.

Answer: C

Explanation:
JSON is widely supported by REST APIs and AI services, making it the preferred format for exchanging structured data.


Question 5

In a Retrieval-Augmented Generation (RAG) solution, why might structured SQL query results be converted to JSON?

A. To include structured business data as context in the prompt sent to the language model.

B. To train the language model.

C. To replace vector embeddings.

D. To eliminate REST APIs.

Answer: A

Explanation:
Structured SQL data converted to JSON can be included in the prompt, allowing the LLM to generate grounded responses using current business information.


Question 6

A developer includes every column from a customer table in the JSON payload, even though only two fields are required.

What is the most likely consequence?

A. Improved retrieval accuracy.

B. Lower API costs.

C. Increased prompt size, token consumption, and latency.

D. Automatic JSON compression.

Answer: C

Explanation:
Sending unnecessary data increases the size of the prompt, which leads to higher token usage, longer response times, and increased cost.


Question 7

Which SQL functions are commonly used to extract values from a JSON response returned by an AI service?

A. ROW_NUMBER and MERGE

B. JSON_VALUE, JSON_QUERY, and OPENJSON

C. PIVOT and UNPIVOT

D. STRING_AGG and GROUP BY

Answer: B

Explanation:
SQL Server provides JSON functions such as JSON_VALUE, JSON_QUERY, and OPENJSON for parsing JSON documents and extracting data.


Question 8

Which practice best improves both security and efficiency when preparing JSON for an AI service?

A. Include every available database column.

B. Return the entire table regardless of the user’s request.

C. Remove unnecessary and sensitive information before generating JSON.

D. Convert the JSON into XML before sending it.

Answer: C

Explanation:
Limiting the JSON payload to only necessary, authorized data reduces token usage, improves performance, and protects sensitive information.


Question 9

What is the primary advantage of using nested JSON structures?

A. They reduce the need for SQL joins.

B. They represent hierarchical relationships in a format that is easier for applications and language models to interpret.

C. They automatically generate embeddings.

D. They eliminate the need for REST APIs.

Answer: B

Explanation:
Nested JSON naturally represents parent-child relationships, making complex business objects easier for both applications and AI models to process.


Question 10

A database application receives a JSON response from an AI service.

What is the next step if the application needs to store the generated summary in a SQL table?

A. Convert the JSON to XML.

B. Rebuild the vector index.

C. Parse the JSON response using SQL JSON functions and extract the required value.

D. Generate new embeddings for the response.

Answer: C

Explanation:
After receiving a JSON response, SQL functions such as JSON_VALUE or OPENJSON can extract the generated content for storage or further processing.


Go to the DP-800 Exam Prep Hub main page

Design and implement JSON columns and indexes (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Design and develop database solutions (35–40%)
   --> Design and implement database objects
      --> Design and implement JSON columns and indexes


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

JSON (JavaScript Object Notation) has become one of the most widely used formats for exchanging data between applications, web services, APIs, cloud platforms, and AI solutions. Modern database applications frequently need to store, query, validate, and index JSON documents alongside traditional relational data.

SQL Server and Azure SQL Database provide extensive built-in support for working with JSON, allowing developers to:

  • Store JSON documents
  • Validate JSON data
  • Query individual properties
  • Modify JSON documents
  • Convert relational data to JSON
  • Convert JSON into relational tables
  • Improve performance by indexing JSON values

For the DP-800: Developing AI-Enabled Database Solutions certification exam, understanding how JSON is stored, queried, and indexed is an important skill because many AI-enabled applications exchange information using JSON.


Why Use JSON?

JSON offers a flexible way to store semi-structured data that doesn’t fit neatly into fixed relational tables.

Common scenarios include:

  • REST API payloads
  • Application configuration
  • Product catalogs
  • Customer preferences
  • Event logs
  • IoT telemetry
  • AI prompts and responses
  • Chat conversation history
  • Metadata storage

Rather than creating dozens of optional columns, JSON allows variable attributes to be stored in a single column.


JSON Support in SQL Server

Unlike some database systems, SQL Server stores JSON as text rather than as a dedicated JSON data type.

Typically, JSON documents are stored in:

  • NVARCHAR(MAX)
  • NVARCHAR(n)

Example:

CREATE TABLE Orders
(
OrderID INT PRIMARY KEY,
CustomerInfo NVARCHAR(MAX)
);

A row might contain:

{
"CustomerID": 125,
"Name": "John Smith",
"City": "Seattle",
"LoyaltyLevel": "Gold"
}

Although stored as text, SQL Server provides built-in functions that understand JSON syntax.


Validating JSON

Before using JSON data, developers should ensure it contains valid JSON.

SQL Server provides the ISJSON() function.

Example:

SELECT ISJSON(CustomerInfo)
FROM Orders;

Returns:

  • 1 = Valid JSON
  • 0 = Invalid JSON

Example using a CHECK constraint:

ALTER TABLE Orders
ADD CONSTRAINT CK_ValidJSON
CHECK (ISJSON(CustomerInfo) = 1);

This prevents invalid JSON from being stored.


Extracting Values with JSON_VALUE()

The JSON_VALUE() function extracts a scalar value from a JSON document.

Example:

SELECT
JSON_VALUE(CustomerInfo,'$.Name')
FROM Orders;

Result:

John Smith

Common uses include:

  • Filtering
  • Sorting
  • Displaying attributes
  • Reporting

Extracting Objects and Arrays with JSON_QUERY()

JSON_QUERY() retrieves an object or array rather than a scalar value.

Example JSON:

{
"CustomerID": 25,
"Orders":
[
{"OrderID":1},
{"OrderID":2}
]
}

Query:

SELECT
JSON_QUERY(CustomerInfo,'$.Orders')
FROM Orders;

Returns the JSON array.


Updating JSON with JSON_MODIFY()

JSON_MODIFY() updates properties without replacing the entire document.

Example:

UPDATE Orders
SET CustomerInfo =
JSON_MODIFY(CustomerInfo,
'$.City',
'Chicago');

Useful when applications maintain customer preferences or AI-generated metadata.


Parsing JSON into Rows with OPENJSON()

OPENJSON converts JSON into relational rows.

Example:

SELECT *
FROM OPENJSON(@json);

Example JSON:

{
"Name":"Alice",
"City":"Boston"
}

Returns:

KeyValue
NameAlice
CityBoston

Using WITH to Define a Schema

OPENJSON becomes much more useful when mapping JSON to columns.

Example:

SELECT *
FROM OPENJSON(@json)
WITH
(
Name NVARCHAR(100),
City NVARCHAR(100),
Age INT
);

This converts JSON directly into relational columns.


Producing JSON with FOR JSON

SQL Server can return query results as JSON.

Example:

SELECT CustomerID,
Name,
City
FROM Customers
FOR JSON AUTO;

Output:

[
{
"CustomerID":1,
"Name":"Alice",
"City":"Boston"
}
]

FOR JSON PATH

FOR JSON PATH provides greater control over the structure.

Example:

SELECT CustomerID,
Name
FROM Customers
FOR JSON PATH;

Developers commonly use this when building REST APIs.


Common JSON Functions

FunctionPurpose
ISJSON()Validate JSON
JSON_VALUE()Return scalar value
JSON_QUERY()Return object or array
JSON_MODIFY()Update JSON
OPENJSON()Convert JSON into rows
FOR JSONProduce JSON output

These functions appear frequently in Microsoft documentation and certification objectives.


Why JSON Indexing Matters

JSON itself is stored as text.

Without indexing, SQL Server must scan every JSON document to locate requested values.

This becomes expensive for large tables.

Example:

SELECT *
FROM Orders
WHERE JSON_VALUE(CustomerInfo,'$.City')='Seattle';

Without indexing, SQL Server evaluates JSON_VALUE() for every row.


Indexing JSON Data

Because JSON is stored in NVARCHAR columns, SQL Server cannot directly create an index on an arbitrary JSON property.

Instead, developers create computed columns that expose JSON properties and then index those computed columns.

This is the recommended approach for SQL Server and Azure SQL Database and is an important DP-800 exam objective.


Creating a Computed Column

Example:

ALTER TABLE Orders
ADD CustomerCity AS
JSON_VALUE(CustomerInfo,'$.City');

SQL Server now treats CustomerCity as a regular column.


Creating an Index

Once the computed column exists, it can be indexed.

Example:

CREATE INDEX IX_Orders_CustomerCity
ON Orders(CustomerCity);

Queries filtering on CustomerCity can now use the index rather than scanning every JSON document.


Persisted Computed Columns

Computed columns may be marked PERSISTED.

Example:

ALTER TABLE Orders
ADD CustomerCity
AS JSON_VALUE(CustomerInfo,'$.City')
PERSISTED;

Benefits include:

  • Value stored physically
  • Faster reads
  • Reduced recalculation

Trade-offs include:

  • Increased storage
  • Slightly slower INSERT/UPDATE operations

JSON Path Expressions

SQL Server identifies JSON elements using path expressions.

Examples:

$.Name
$.Address.City
$.Orders[0]
$.Orders[1].Price

The dollar sign ($) represents the root of the JSON document.

Understanding JSON path syntax is essential for using JSON functions correctly.


Nested JSON

Example:

{
"Customer":
{
"Name":"Alice",
"Address":
{
"City":"Boston"
}
}
}

Extracting City:

SELECT
JSON_VALUE(CustomerInfo,
'$.Customer.Address.City');

Working with JSON Arrays

Example JSON:

{
"Products":
[
{"ID":1},
{"ID":2},
{"ID":3}
]
}

Retrieve the array:

SELECT
JSON_QUERY(OrderInfo,'$.Products');

Convert to rows:

SELECT *
FROM OPENJSON
(
JSON_QUERY(OrderInfo,'$.Products')
);

JSON Design Considerations

JSON is ideal when:

  • Attributes vary significantly between rows.
  • Schema flexibility is required.
  • Data originates from APIs.
  • AI systems generate dynamic metadata.
  • Semi-structured information must be stored.

Relational tables are preferable when:

  • Strong relationships exist.
  • Frequent joins are required.
  • Referential integrity must be enforced.
  • Structured reporting dominates the workload.

Many production databases combine relational columns with JSON columns.


JSON and AI Applications

JSON is heavily used throughout AI-enabled database solutions.

Common examples include:

  • Storing AI prompt templates
  • Saving LLM responses
  • Recording chat history
  • Persisting vector search metadata
  • Storing application configuration
  • Capturing model parameters
  • Logging AI inference results

Because AI services frequently communicate using JSON, SQL Server’s JSON functionality is an important integration capability.


Performance Considerations

When working with JSON:

  • Validate incoming JSON using ISJSON().
  • Avoid repeatedly evaluating JSON_VALUE() in large queries.
  • Create computed columns for frequently queried properties.
  • Index computed columns used in WHERE, JOIN, or ORDER BY clauses.
  • Persist computed columns when read performance outweighs storage costs.
  • Avoid storing extremely large documents unless necessary.
  • Use OPENJSON() for efficient ingestion of structured JSON payloads.

Best Practices

  • Store only valid JSON documents.
  • Keep relational data relational whenever practical.
  • Use JSON for flexible or semi-structured attributes.
  • Use JSON_VALUE() for scalar values.
  • Use JSON_QUERY() for arrays and objects.
  • Use JSON_MODIFY() for updates.
  • Use OPENJSON() to transform JSON into relational rows.
  • Create computed columns for frequently searched JSON properties.
  • Index computed columns to improve query performance.
  • Test execution plans to verify indexes are being used.

Common Exam Tips

For the DP-800 exam, remember these key points:

  • SQL Server stores JSON as NVARCHAR, not as a native JSON data type.
  • ISJSON() validates JSON syntax.
  • JSON_VALUE() returns a scalar value.
  • JSON_QUERY() returns an object or array.
  • JSON_MODIFY() updates JSON documents.
  • OPENJSON() converts JSON into relational rows.
  • FOR JSON AUTO and FOR JSON PATH generate JSON output from SQL queries.
  • JSON properties are typically indexed by exposing them through computed columns and creating indexes on those columns.
  • Persisted computed columns can improve read performance at the cost of additional storage and update overhead.

Practice Exam Questions

Question 1

A developer needs to verify that incoming API payloads contain valid JSON before storing them in a table. Which SQL Server function should be used?

A. JSON_QUERY()

B. OPENJSON()

C. JSON_VALUE()

D. ISJSON()

Answer: D

Explanation: ISJSON() validates whether a string contains properly formatted JSON. It returns 1 for valid JSON and 0 for invalid JSON, making it ideal for validation and CHECK constraints.


Question 2

A developer wants to retrieve the value of the City property from a JSON document stored in an NVARCHAR column. Which function should be used?

A. JSON_VALUE()

B. JSON_QUERY()

C. JSON_MODIFY()

D. OPENJSON()

Answer: A

Explanation: JSON_VALUE() extracts a single scalar value from a JSON document, such as a string, number, or Boolean.


Question 3

Which statement accurately describes how SQL Server stores JSON data?

A. SQL Server stores JSON in a dedicated JSON data type.

B. SQL Server stores JSON as XML internally.

C. SQL Server stores JSON as character data, typically in an NVARCHAR column.

D. SQL Server automatically converts JSON into relational columns.

Answer: C

Explanation: SQL Server does not provide a native JSON data type. JSON documents are stored as text, typically in NVARCHAR(MAX) or NVARCHAR(n) columns.


Question 4

A query frequently filters on the value returned by JSON_VALUE(CustomerInfo,'$.City'). What is the recommended way to improve query performance?

A. Create a clustered index on the JSON column.

B. Create a computed column using JSON_VALUE() and index the computed column.

C. Replace the JSON column with XML.

D. Create a foreign key on the JSON column.

Answer: B

Explanation: SQL Server cannot directly index an arbitrary JSON property. The recommended approach is to expose the property through a computed column and then create an index on that computed column.


Question 5

A developer needs to retrieve an entire JSON array from a document rather than a single scalar value. Which function should be used?

A. JSON_QUERY()

B. JSON_VALUE()

C. ISJSON()

D. JSON_MODIFY()

Answer: A

Explanation: JSON_QUERY() returns a JSON object or array, whereas JSON_VALUE() returns only scalar values.


Question 6

Which SQL Server feature converts relational query results into JSON output?

A. OPENJSON

B. JSON_VALUE

C. FOR JSON

D. JSON_MODIFY

Answer: C

Explanation: The FOR JSON clause formats SQL query results as JSON. Both AUTO and PATH modes are available.


Question 7

A developer receives a JSON document containing thousands of customer records and wants to transform it into relational rows for loading into SQL Server. Which function should be used?

A. JSON_QUERY()

B. JSON_MODIFY()

C. ISJSON()

D. OPENJSON()

Answer: D

Explanation: OPENJSON() parses JSON documents and converts them into rows and columns. It is commonly used for importing JSON data.


Question 8

What is the primary advantage of creating a persisted computed column based on a JSON property?

A. It automatically encrypts the JSON document.

B. It physically stores the computed value, reducing recalculation during queries.

C. It compresses the JSON document.

D. It converts JSON into XML.

Answer: B

Explanation: A persisted computed column stores its calculated value on disk, improving query performance by avoiding repeated evaluation of the expression.


Question 9

Which JSON path expression retrieves the City property nested inside an Address object?

A. $.City.Address

B. $.Address.City

C. $.Address[City]

D. $.City->Address

Answer: B

Explanation: JSON path expressions begin at the root ($) and navigate nested objects using dot notation, such as $.Address.City.


Question 10

Which scenario is the best candidate for storing information in a JSON column instead of creating many optional relational columns?

A. A highly normalized customer master table with strict referential integrity

B. A table containing only integer values

C. A fixed employee payroll table with mandatory attributes

D. A product catalog in which different product categories have different sets of optional attributes

Answer: D

Explanation: JSON is well suited for semi-structured or variable data, such as product attributes that differ across categories, avoiding the need for numerous nullable columns while maintaining flexibility.


Go to the DP-800 Exam Prep Hub main page