Pergunta de entrevista da empresa Amazon

Group by clause, having clause etc