added sql reporting