Postgresql Sum Group By Sql Interview