sql queries to better understand table contents