Question 800
A database architect reviews two implementation risks. A SQL view extracts a scalar field from a JSON payload but occasionally receives invalid JSON and crashes the report. A service expects a database API to return a nested JSON object with named attributes rather than concatenated free-text strings. Which course of action addresses the stated issues?
Explanation
Correct Answer
First, semi-structured input needs validation and predictable failure behavior before scalar values enter authoritative reports. Second, JSON construction functions preserve key/value structure without brittle manual delimiter concatenation.
Incorrect Answers
Construct the response using JSON_OBJECT or the platform's supported JSON construction functions and verify the output schema; do not validate JSON input and use appropriate supported JSON extraction with error handling for malformed payloads: validate JSON input and use appropriate supported JSON extraction with error handling for malformed payloads.
Validate JSON input and use appropriate supported JSON extraction with error handling for malformed payloads; evaluate a supported JSON indexing strategy or an indexed computed extraction for the frequently filtered property: jSON construction functions preserve key/value structure without brittle manual delimiter concatenation.
Use OPENJSON with an explicit schema for the array entries and validate keys before relational insertion; Construct the response using JSON_OBJECT or the platform's supported JSON construction functions and verify the output schema: semi-structured input needs validation and predictable failure behavior before scalar values enter authoritative reports.



Developing AI-Enabled Database Solutions (DP-800) Practice Tests