Mayuresh Kathe <[email protected]> writes: > Does Org mode provide functionality to work through locally dumped > data via simple querying tools like the SQL and/or Datalog? > > E.g. https://github.com/factbook/cache.factbook.json could be dumped > to local disk and queried by issuing statements like "show me all > ammunition manufactured after 1950 that is between .30 and .40" and it > could just return it nearly instantly. > > The above hypothetical scenario is based on a HN post > (https://news.ycombinator.com/item?id=47114530) and it has some very > interesting comments for it.
Hello, SQL is one of the many languages supported by Org mode's literate programming functionality, org-babel. This means that in an Org file, you can mix descriptive text with executable SQL queries and tables with updatable query results. You can also chain together code blocks in different languages, e.g. to pass the results of an SQL query to a Gnuplot or R code block for plotting, all in the same document. This ability to store and process queries along with notes in a structured document can be very helpful for exploring a dataset. One still needs to write the SQL, though. :) Btw, I see that there's also a nice website for the dataset you mention at https://worldfactbookarchive.org, and a repository with SQL insert scripts at https://github.com/MilkMp/CIA-World-Factbooks-Archive-1990-2025, which may be more useful than the raw JSON files. Regards, Christian
