? Data being processed must contain statistics. What should you do? A. Update Table1 by using a common table expression (CTE). B. Insert the data into a temporary table, and then update Table1 from the temporary table. C. Place the SELECT statement in a derived table, and then update Table1 by using a JOIN to the derived table. D. Insert the data into a table variable, and then update Table1 from the table variable. Answer: B Explanation: Temp Tables... Are real materialized tables that exist in tempdb Have dedicated stats generated by the engine Can be indexed Can have constraints Persist for the life of the current CONNECTION Can be referenced by other queries or subproce
QUESTION: 59 DRAG DROP Note: This question is part of a series of questions that use the same scenario. For your convenience, the scenario is repeated in each question. Each question presents a different goal and answer choices, but the text of the scenario is exactly the same in each question in this series. You are developing a database to track customer orders. The database contains the following tables: Sales.Customers, Sales.Orders, and Sales.OrderLines. The following table describes the columns in Sales.Customers. The following table describes the columns in Sales.Orders. The following table describes the columns in Sales.OrderLines. You need to create a function that accepts a CustomerID as a parameter and returns the following information: - all customer information for the customer - the total number of orders for the customer - the total price of all orders for the customer - the average quantity of items per order How should you complete the function definition? To answer, drag the appropriate Transact-SQL segment to the correct locations. Transact-SQL segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or
scroll to view content. Answer: Exhibit Explanation: Exhibit
Box1: RETURNS TABLE The function should return the following information: - all customer information for the customer - the total number of orders for the customer - the total price of all orders for the customer
You've reached the end of your free preview.
Want to read all 14 pages?
- Fall '20