We wish to generate the common summary statistics for all columns in a table for each group, where the groups are defined by one or more grouping columns. Examples of summary statistics are quantiles for numeric columns and unique value count for non-numeric columns. While we can compute each of these statistics for each column of a table individually, it would be efficient during data inspection to use a function that given a grouped table, computes the common statistics for each of the table’s columns appropriate for the column’s data type.
Unfortunately, there is no efficient and neat way of doing this in sql. We can write a very complex sql procedure that can do this, but we recommend doing this in R or Python. For more details please see Data Set Summary In Python and Data Set Summary In R