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: 12
DRAG DROP You have an Azure SQL database named DB1 that contains two tables named knowledgebase and query_cache. knowledge_base contains support articles and embeddings. query_cache contains chat questions, responses, and embeddings DB1 supports an Al-enabled chat agent. You need to design a solution that meets the following requirements: • Serializes the retrieved rows from knowledee_base • Extracts the answer field from the response • Extracts the embeddings to store in query_cache You will call the external large language model (LLM) by using the sp_irwoke_external_re standpoint stored procedure. Which Transact-SGL commands should you use for each requirement? To answer, drag the appropriate commands to the correct requirements. Each command may be used once, mote than once, or not at all. You 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 retrieved rows from knowledge base: B. FOR JSON PATH
Extract the answer field from the response: E. JSON VALUE
Extract the embeddings to store in query_cache: D. JSON QUERY
Explanation
To serialize relational data from the knowledge_base table into a JSON string suitable for an LLM REST API payload, FOR JSON PATH is required. When parsing the JSON response returned by the sp_invoke_external_rest_endpoint procedure, you must handle different data structures appropriately. JSON_VALUE is utilized to extract scalar values, such as the single text string representing the generated "answer" field. Embeddings, however, are represented as JSON arrays (vectors). In Transact-SQL, JSON_QUERY is specifically designed to extract complex JSON objects or arrays from a larger JSON document, making it the required command to retrieve the embedding array so it can be inserted into the query_cache table.
References
Microsoft Learn: Format Query Results as JSON with FOR JSON (SQL Server)
Section: Use FOR JSON PATH
Context: Details how to format SELECT statement results as JSON text, which is required for serializing database rows to send to a REST endpoint.
Microsoft Learn: JSON_VALUE (Transact-SQL)
Section: Remarks & Examples
Context: Explicitly states that JSON_VALUE extracts a scalar value (like a string, number, or boolean) from a JSON string, which applies to extracting the text "answer".
Microsoft Learn: JSON_QUERY (Transact-SQL)
Section: Remarks & Examples
Context: States that JSON_QUERY extracts an object or an array from a JSON string. It specifically notes that to extract an array (such as vector embeddings), you must use JSON_QUERY rather than JSON_VALUE.
Microsoft Learn: sp_invoke_external_rest_endpoint (Transact-SQL)
Section: Examples (Azure SQL Database)
Context: Demonstrates calling Azure OpenAI models using this stored procedure, highlighting the use of JSON parsing functions to handle the input payload and extract the generated response vectors and text.