parsing query for table name