Ultimate access to all questions.
Upgrade Now 🚀
Sign in to unlock AI tutor
In a scenario where you need to calculate a rolling average of daily sales over a period of six months, which SQL technique would be most appropriate, and how would you implement it in a query? Consider the use of window functions and data grouping.
A
Use a simple GROUP BY clause to aggregate sales by day.
B
Use a JOIN operation to combine sales data with a date table.
C
Use a window function like AVG() OVER() to calculate the rolling average.
D
Use a subquery to calculate the average sales per day first.