How To Write Sql Query In Python