Php Count Different Values In Array Postgresql Interview