retrieve table information from database