CORRECT TEXT

CORRECT TEXT
You have a database named Sales 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:
Return rows ordered by descending values in the UnitPrice column.
Use the Rank function to calculate the results based on the UnitPrice column.
Return the ranking of rows in a column that uses the alias PriceRank.
Use two-part names to reference tables.
Display the columns in the order that they are defined in the table. The PriceRank column must appear last.
Part of the correct T-SQL statement has been provided in the answer area. Provide the complete code.


microsoft-exams

3 thoughts on “CORRECT TEXT

  1. Correct Answer:

    SELECT ProductCatlog.CatId, ProductCatlog.CatName,ProductCatlog.ProductID,ProductCatlog.ProdName,
    ProductCatlog.UnitPrice,
    RANK() Over(Order By ProductCatlog.UnitPrice Desc) As PriceRank
    FROM Sales.ProductCatlog
    Order By ProductCatlog.UnitPrice Desc

  2. Correct Answer:

    SELECT ProductCatlog.CatId, ProductCatlog.CatName,ProductCatlog.ProductID,ProductCatlog.ProdName,
    ProductCatlog.UnitPrice,
    RANK() Over(Order By UnitPrice Desc) As PriceRank
    FROM Sales.ProdcutCatlog
    Order By PriceRank

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.