modified generate_divided_tables_sql.pl