Pregunta de entrevista de Amazon

Group by clause, having clause etc