まずtableがデータベースのテーブルではなくカラムになっていて紛らわしい
通報されるレベル

cursor.execute()の前にcursor(prepared=True)を実行しているか分からないが大丈夫か?

> cursor.execute(sql_2, (table, table, x_min, table, x_max))

は問題がないように見える

> cursor.execute(sql_2, (table, x_min, x_max))

は%sと引数の数があっていない

> cursor.execute(sql_3, {'table': table, 'x_min': x_min, 'x_max': x_max})

はこの文法が通用するのは比較的新しいPyMySQL(0.7.9以降?)だがバージョンは大丈夫か?

https://github.com/PyMySQL/PyMySQL/blob/73c22c78d14466a5ed8029ef67ca11198234913e/pymysql/cursors.py#L158