Mastek interview question

SQL query about group by, aggregate functions and having clause