MetricStream interview question

question on SQL queries