Combination of GroupBy and SQL functions(Min,Max,Avg)