Pergunta de entrevista da empresa Infosys

Asked me to write a sql query for group by and having clause.