Question: SQL (no data required) Show a list of product names and unit prices ranked by unit price into three categories based on price: 1, 2,
SQL (no data required)
- Show a list of product names and unit prices ranked by unit price into three categories based on price: 1, 2, 3. The highest-priced products will be marked with a 1, the second category as 2, and the last category as 3. HINT: this is NTILE(3) over unit price, DESC.
- Show a list of product names and units on order, ranked based on units on order, highest to lowest. HINT: this is NTILE(100) over units on order DESC. Order the records by their rank in the percentile, ascending.
- Show a list of product names and units in stock from categories 1, 2, 4, 5, and 7. Show their RANK() based on units in stock, ASC (46 records).
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
