Summarizing a SQL list and viewing table-related information