Seven-Day Moving Average
Talk it through out loud with your AI coach.
The problem
- medium
- Pro
Daily order numbers jump around so much that the trend is hard to see, and your manager asks for a seven-day moving average. Explain how you'd calculate it in SQL and the traps to avoid.
What a strong answer covers
- Getting to one row per day before smoothing.
- How a window over neighbouring days produces the average.
- Why gaps in the dates break the calculation, and how to fill them.
- How to treat the start of the series.
Common mistake: Applying the window directly to raw orders or to days with gaps, so the average no longer covers seven days.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud