Amazon Robotics interview question

SQL aggregation coding, including group by and having.