Sql Select Multiple Conditions In Python If You Executed