Runs a generic SQL query into a materialized report table.