So, I've been trying to figure this out a bit lately.
How would you go about writing a customer facing query builder that is analogous to the MongoDB aggregation pipeline with SQL?
With MongoDB I could conceivably generate/store a JSON object for such a query. In SQL it seems a lot more obtuse to do.