Added test for verifying proper sql generated by minimum aggregate method