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.

A. Please review the part for this answer

microsoft-exams

4 thoughts on “CORRECT TEXT

  1. What about “Use two-part names to reference tables.”

    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. In the question it says “Return rows ordered by descending values in the UnitPrice column.”

    SELECT CatID, CatName, ProductID, ProdName, UnitPrice, RANK() OVER(ORDER BY UnitPrice DESC) AS PriceRank
    FROM Sales.ProductCatalog
    ORDER BY PriceRank DESC

    1. disregard the upper comment..

      SELECT CatID, CatName, ProductID, ProdName, UnitPrice, RANK() OVER(ORDER BY UnitPrice DESC) AS PriceRank
      FROM Sales.ProductCatalog
      ORDER BY UnitPrice DESC

  3. SELECT CatID, CatName, ProductID, ProdName, UnitPrice, RANK() OVER(ORDER BY UnitPrice DESC) AS PriceRank
    FROM Sales.ProductCatalog
    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.