Question: Write a SELECT statement that uses the ranking functions to rank products by the total quantity sold. Return these columns: The product_name column from the
Write a SELECT statement that uses the ranking functions to rank products by the total quantity sold. Return these columns: The product_name column from the Products table A column named total_quantity that shows the sum of the quantity for each product in the Order_Items table A column named rank that uses the RANK function to rank the total quantity in descending sequence A column named dense_rank that uses the DENSE_RANK function to rank the total quantity in descending sequence.
Step by Step Solution
3.42 Rating (155 Votes )
There are 3 Steps involved in it
To address the question we need to use SQL to retrieve data from two tables Products and OrderItems ... View full answer
Get step-by-step solutions from verified subject matter experts
