summarizeData function

A function to summarize data from the database