Contoso has an Azure subscription in North Europe that contains the corporate infrastructure. The current infrastructure contains a Microsoft SQL Server 2017 database. The database contains the following tables.
The FeedbackJson column has a full-text index and stores JSON documents in the following format.
The support staff at Contoso never has the unmask permission.
Requirements
Contoso is deploying a new Azure SQL database that will become the authoritative data store for the following;
Sometimesthe ingestion pipeline fails due to malformed JSON and duplicate payloads.
The engineers at Contoso report that the following dashboard query runs slowly.
SELECT VehicleTd, Lastupdatedutc, EngineStatus, BatteryHealth FROM dbo.VehicleHealthSumary where fleetld- gFleetld ORDER BV LastUpdatedUtc DESC;
You review the execution plan and discover that the plan shows a clustered index scan.
vehicleincidentReports often contains details about the weather, traffic conditions, and location. Analysts report that it is difficult to find similar incidents based on these details
Planned Changes
Contoso wants to modernize Fleet Intelligence Platform to support Al-powered semantic search over
incident reports.
Security Requirements
Contoso identifies the following telemetry requirements:
• Telemetry data must be stored in a partitioned table.
• Telemetry data must provide predictable performance for ingestion and retention operations.
• latitude, longitude, and accuracy JSON properties must be filtered by using an index seek.
Contoso identifies the following maintenance data requirements:
• Ensure that any changes to a row in the MaintenanceEvents table updates the corresponding
value in the LastModif reduce column to the time of the change.
• Avoidrecursive updates.
AI Search, Embedding’s, and Vector indexing
The development learn at Contoso will use Microsoft Visual Studio Code and GitHub Copilot and will
retrieve live metadata from the databases. Contoso identifies the following requirements for
querying data in the FeedbackJson column of the customer-Feedback table:
• Extract the customer feedback text from the JSON document.
• Filter rows where the JSON text contains a keyword.
• Calculate a fuzzy similarity score between the feedback text and a known issue description.
• Orderthe results by similarity score, with the highest score first
View Mode
Q: 14
DRAG DROP You have an Azure SQL database named SalesDB that contains tables named Sales.Orders and Sales.OrderLines. Both tables contain sales data You have a Retrieval Augmented Generation (RAG) service that queries SalesDB to retrieve order details and passes the results to a large language model (ILM) as JSON text. The following is a sample of the JSON. You need to return one 1SON document per order that includes the order header fields and an array of related order lines. The LIM must receive a single JSON array of orders, where each order contains a lines property that is a JSON array of line Items. Which transact-SQL commands should you use to produce the required JSON shape from the relational tables? To answer, drag the appropriate commands to the correct operations. Each command may be used once, more than once, or not at all. Vou may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point.
Drag & Drop
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Correct Answer:
Answer Area
Serialize the order-level JSON: A. FOR JSON PATH
Generate a nested lines array: A. FOR JSON PATH
Extract a single scalar value from the ISON text: D. JSON_VALUE
Explanation
To convert relational data from the Sales.Orders table into a structured JSON format, the FOR JSON PATH clause is used, as it serializes the query results and provides full control over the document's properties. To generate the nested lines array containing items from Sales.OrderLines, a correlated subquery utilizing FOR JSON PATH is required; this natively formats the joined relational rows into a nested JSON array. Finally, JSON_VALUE is the specific Transact-SQL function designed to parse and extract a single scalar value (such as a string, integer, or boolean) from a JSON string, whereas functions like JSON_QUERY are strictly for extracting JSON objects or arrays.
References
Microsoft Learn. "Format query results as JSON with FOR JSON (SQL Server)." Microsoft SQL Server Documentation. Specifically, the section on "Use FOR JSON PATH" and "Nested FOR JSON queries"
Microsoft Learn. "JSON_VALUE (Transact-SQL)." Microsoft SQL Server Documentation. Outlines the extraction of scalar values.
Microsoft Learn. "JSON Data in SQL Server." Microsoft SQL Server Documentation. Details the architectural differences between extracting scalars (JSON_VALUE) vs. arrays/objects (JSON_QUERY)