customer spending sql intermediate hackerrank solution