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: 9
HOTSPOT You have an Azure SQL database that contains a table named stores, stores contains a column named description and a vector column named embedding. You need to implement a hybrid search query that meets the following requirements: • Uses full-text search on description for the keyword portion • Returns the top 20 results based on a combined score that uses a weighted formula of 60% vector distance and 40% full-text rank How should you configure the query components? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.
Your Answer
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.
Correct Answer:
SEMANTIC QUERY OPERATOR/FUNCTION:VECTOR_DISTANCE AND ORDER BY DISTANCE ASCENDING
KEYWORD RETRIEVAL OPERATOR/FUNCTION:CONTAINSTABLE ON DESCRIPTION AND RETURN RANKED MATCHES
FINAL RANKING EXPRESSION:ORDER BY (DISTANCE * 0.6) + ((1.0 - RANK/1000.0) * 0.4)(NOTE: ASSUMING THE MISSING MINUS SIGN IN THE FIRST DROPDOWN OPTION IS A VISUAL TYPO IN THE PROVIDED IMAGE).
Explanation
Semantic query: Azure SQL Database supports native vector search primarily via the VECTOR_DISTANCE function, which calculates the mathematical distance between two vectors. Because a smaller distance means higher semantic similarity, the query must be ordered by distance in ascending order.
Keyword retrieval: The requirement explicitly asks for a "full-text search... for the keyword portion" that will be used in a weighted formula. CONTAINSTABLE evaluates exact or prefix keyword matches and natively returns a RANK column with values from 0 to 1000. FREETEXTTABLE searches for underlying meaning rather than exact keywords, making it less precise for pure "keyword" requirements.
Final ranking: To combine these two scores mathematically, they must align on the same directional scale. Vector distance is a "lower-is-better" metric, while the full-text RANK is a "higher-is-better" metric (0 to 1000). By dividing the RANK by 1000.0, you normalize it to a 0–1 scale. Subtracting it from 1.0 (1.0 - RANK/1000.0) inverts the scale so that it also becomes a "lower-is-better" metric. Finally, applying the requested 60% / 40% weights yields a unified score that can be accurately ordered.
References
Azure SQL Vector Search & Functions: Microsoft Learn, "Vector & Embeddings Frequently Asked Questions (FAQ) - SQL Server" — details the implementation of vector distance queries and native functions. (https://learn.microsoft.com/en-us/sql/sql-server/ai/vectors-faq)
Hybrid Search Architecture: Microsoft Learn, "Microsoft SQL Server Database Provider - Vector Search - EF Core" — provides the architectural blueprint for combining exact semantic similarity (VECTOR_DISTANCE) with traditional full-text query components. (https://learn.microsoft.com/en-us/ef/core/providers/sql-server/vector-search)