save statistical data to database