Beginning of Python SQL query script