Question 21
Open question ↗You need to calculate a rolling 30-day sales average per region and also rank the top-selling products within each region. The query must remain set-based and readable.
Which approach should you recommend?
- A.Use a cursor to iterate through each region and product.
- B.Use window functions with PARTITION BY and ORDER BY.
- C.Export the data to CSV and calculate the rankings in Excel.
- D.Create a trigger that writes aggregate rows during every insert.