Kay Abraham

Local time in Prague:

Machines05 / 07

SQL library

Shared queries any Product Advocate runs with parameters. Pricing and usage questions get answered in minutes.

Status
Running
Since
In use since September 2026
Built with
SQL · Redash
01

The miss

Every pricing or usage question turned into a data request, and then we waited.

Corrected SQL library K.A.

02

The machine

A library of shared, parameterised SQL queries on Snowflake, run through Redash. Ten of them. Any Product Advocate picks a query, sets the parameters and reads the answer.

03

How it runs

  1. How SQL library runs, step by step:
  2. Question to Pick
  3. Pick to Parameters
  4. Parameters to Run
  5. Run to Answer
Made-up item
04

Under the hood

  1. Ten shared, parameterised queries.
  2. Any Product Advocate runs them: pick one, set the parameters, read the answer.
  3. In use since September 30.
usage_by_plan.sqlSketch
-- usage for one account over a date rangeselect plan,       sum(usage_units)        as usage,       count(distinct day)     as active_daysfrom usage_dailywhere account = '{{ account }}'  and day between '{{ from }}' and '{{ to }}'group by planorder by usage desc;

One query of the ten, written for this page. The {{ }} fields are Redash parameters; names are made up.

05

What changed

  • Pricing and usage questions take minutes.
06

What I can show

Company data sits behind it, so this page describes it.

Back to the machines