checkTablesColumns function

Check if the given tables and columns are valid and return the loaded data.