MetricStream Interview Question

question on SQL queries