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.
guys why are most of your answers wrong u mislead people
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
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