Writing Sql Queries In Python