added sql queries for table generation and  populating