posted an update —

Note that returning the SQL to the user is helpful for two reasons, even given that the intended users are non-technical and don't know SQL:

(1) It is possible to scan the SQL and make sure that your criteria is being taken into account. For example, if you're only wanting counts in Asheville, NC, you should see "NC" and "Asheville" in the SQL somewhere.

(2) Saving the SQL and the count helps you show technical staff later on exactly what was queried to get the result, as an audit trail, so that there isn't a "that's not the real number" debate that doesn't have a root cause.

Log in or sign up for Devpost to join the conversation.