SpinTheMic
Pro

Interview practice question

Flagging unusual daily metrics with SQL

Data Analyst · SQL for Analytics · Experienced

How would you flag days where a metric is unusually high or low compared with recent history, using only SQL?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Rolling mean and stddev over prior N days.
  • z-score = (value − mean) / stddev.
  • Exclude current day from baseline.
  • Day-of-week seasonality.
  • Thresholds, e.g., |z| > 3.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics