Sample Code: SMARTQuery