Câu 67: 70-461: MCSA Querying Microsoft SQL Server 2012/2014
SIMULATION -You have a database that contains the tables as shown in the exhibit. (Click the Exhibit button.) You need to create a query that returns a list of products from Sales.ProductCatalog. The solution must meet the following requirements:UnitPrice must be returned in descending order. ✑ The query must use two-…
Nội dung câu hỏi
SIMULATION -You have a database that contains the tables as shown in the exhibit. (Click the Exhibit button.) You need to create a query that returns a list of products from Sales.ProductCatalog. The solution must meet the following requirements:UnitPrice must be returned in descending order. ✑ The query must use two-part names to reference the table. ✑ The query must use the RANK function to calculate the results. ✑ The query must return the ranking of rows in a column named PriceRank. ✑ The list must display the columns in the order that they are defined in the table. ✑ PriceRank must appear last. To answer, type the correct code in the answer area. Part of the correct T-SQL statement has been provided in the answer area. Provide the complete code.
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. Please review the explanation part for this answer. Explantation:SELECT ProductCatalog.CatID, ProductCatalog.CatName, ProductCatalog.ProductID,ProductCatalog.ProdName,ProductCatalog.UnitPrice,RANK() OVER (ORDER BY ProductCatalog.UnitPrice DESC) AS PriceRankFROM Sales.ProductCatalog -ORDER BY ProductCatalog.UnitPrice DESC References:https://msdn.microsoft.com/en-us/library/ms176102.aspx — đáp án hiện tại
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.