QuestionQ29
Design and develop database solutionsYou have an Azure SQL database named SalesDB that contains tables named Sales.Orders and Sales.OrderLines. Both tables hold sales data.
A Retrieval Augmented Generation (RAG) service queries SalesDB to retrieve order details and passes the results to a large language model (LLM) as JSON text. The following is a simple example of the JSON.

You need to return one JSON document per order that includes the order header fields and an array of related order lines. The LLM 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? Each command may be used once, more than once, or not at all.
Community Discussion