#+begin_src emacs-lisp (require 'ob-sqlite) #+end_src
#+RESULTS: : ob-sqlite
* Headline 1
* Headline 2 #+begin_src sqlite :db users.db :colnames yes select * from users where id > 1 limit 10 #+end_src
#+plot: set:"xlabel 'id'" set:"ylabel 'N'"
#+begin_src emacs-lisp (require 'ob-sqlite) #+end_src
#+RESULTS: : ob-sqlite
* Headline 1
* Headline 2 #+begin_src sqlite :db users.db :colnames yes select * from users where id > 1 limit 10 #+end_src
#+plot: set:"xlabel 'id'" set:"ylabel 'N'"
OP wrote that people have been doing similar things for a long time. They are aiming to standardize and polish this approach.
1. here is plot equivalent of evidence #+plot: set:"xlabel 'day_of_year '" set:"ylabel 'cum_vol'" <LineChart data={data.daily_volume_yoy} x=day_of_year y=cum_vol series=year units="cumulative calls" xAxisTitle="day of year"/>
2. sql equivatent, note that org mode also supports other languages i.e. python/bash etc. that is the reason you need to specify sqlite here #+begin_src sqlite :db users.db :colnames yes select count() as total_calls, countif(timestamp_diff(current_timestamp(), created_date, day) <7) as calls_in_the_last_7_days, countif(timestamp_diff(current_timestamp(), created_date, day) <365) as calls_in_the_last_365_days, min(created_date) as earliest_call_date, max(created_date) as latest_call_date from `bigquery-public-data.austin_311.311_service_requests` limit 1 #+end_src
```summary select count() as total_calls, countif(timestamp_diff(current_timestamp(), created_date, day) <7) as calls_in_the_last_7_days, countif(timestamp_diff(current_timestamp(), created_date, day) <365) as calls_in_the_last_365_days, min(created_date) as earliest_call_date, max(created_date) as latest_call_date from `bigquery-public-data.austin_311.311_service_requests` limit 1 ```
3. Document * Recent Call Volume Spikes # Recent Call Volume Spikes
And still, your code has lots of "line noise", so I consider it uglier, but that's a personal preference.