the for loop iterates through a data table column with ids to access two tables at a time using the geoquery database package. in each iteration, two tables are joined and