An example where
SELECT FOR UPDATE is a good solution to an use case can be seen at: nodejs/sequelize/raw/parallel_select_and_update.js.SELECT FOR UPDATE vs/together with the SQL transaction isolation level is commented at: stackoverflow.com/questions/10935850/when-to-use-select-for-update.When Ciro finally understood that this is a play on Larry Page's name (of course it is, typical programmer/academic humor stuff), his mind blew.
In particular, everything that happens in a trigger happens as if it were in a transaction. This way, you can do less explicit transactions when you use triggers. It is a bit like the advantages of SQL CASCADE.
DBMS:
PostgreSQL requires you to define a SQL stored procedure: stackoverflow.com/questions/28149494/is-it-possible-to-create-trigger-without-execute-procedure-in-postgresql Their syntax may be standard compliant, not sure about the
EXECUTE part. Their docs: www.postgresql.org/docs/current/sql-createtrigger.htmlSQLite does not support SQL stored procedures at all, so maybe that's why they can't be standard compliant here: stackoverflow.com/questions/3335162/creating-stored-procedure-in-sqlite
SQL:1999 11.38 covers "Trigger definition". The Abstract syntax tree starts with the
CREATE TRIGGER and ends in:<triggered SQL statement> ::=
<SQL procedure statement>This is defined at 13.5 "SQL procedure statement", but that is humongous and I'm not sure what it is at all.
Basic example tested on SQLite 3.40.1, Ubuntu 23.04:output:
sqlite3 :memory: 'select 1 union select 2'1
2Two columns two rows:output:
sqlite3 :memory: <<EOF
select * from (values (1, 2), (2, 3))
union
select * from (values (2, 3), (3, 4))
EOF1|2
2|3
3|4Note how duplicates are removed, to keep them we output:
UNION ALL instead:sqlite3 :memory: <<EOF
select * from (values (1, 2), (2, 3))
union all
select * from (values (2, 3), (3, 4))
EOF1|2
2|3
2|3
3|4AKA how this GitHub page gets served under the domain: cirosantilli.com
Ciro only touches this very rarely, and always forgets and go into great pain whenever a change needs to done, so it is important to document it.
The last change was of 2019-07-07, when Ciro moved from the www subdomain www.cirosantilli.com to the APEX cirosantilli.com. A redirect is setup from the www subdomain to APEX.
GoDaddy DNS entries:
Type Name Value TTL
A @ 185.199.108.153 1 Hour
A @ 185.199.109.153 1 Hour
A @ 185.199.110.153 1 Hour
A @ 185.199.111.153 1 Hour
CNAME www cirosantilli.github.io 1 HourMoved cirosantilli.com to Porkbun 2022-02, unfortunatly records were not automatically updated and domain went down for a bit, upadded to new entries for IPv6 as well which are not documented by GitHub:
TYPE HOST ANSWER TTL PRIORITY OPTIONS
A cirosantilli.com 185.199.108.153 600
A cirosantilli.com 185.199.109.153 600
A cirosantilli.com 185.199.110.153 600
A cirosantilli.com 185.199.111.153 600
AAAA cirosantilli.com 2606:50c0:8000::153 600
AAAA cirosantilli.com 2606:50c0:8001::153 600
AAAA cirosantilli.com 2606:50c0:8002::153 600
AAAA cirosantilli.com 2606:50c0:8003::153 600
CNAME www.cirosantilli.com cirosantilli.github.io 600where the IPs are obtained from: help.github.com/en/articles/setting-up-an-apex-domain#configuring-a-records-with-your-dns-provider (archive).
- Custom domain:
cirosantilli.com - Enforce HTTPS: checked
And the CNAME file is tracked in this repository: CNAME.
python3 -m pip install --user virtualenv
virtualenv .venv
. .venv/bin/activate
pip install -r requirements.txt Update multiple rows with different values in a single SQL query by
Ciro Santilli 40 Updated 2025-07-16
Dumping examples under nodejs/sequelize/raw/many_to_many.js.
Not possible without subqueries in the standard syntax, a huge shame: stackoverflow.com/questions/1293330/how-can-i-do-an-update-statement-with-join-in-sql-server
The Google Story suggests that this practice existed in academia, where it was brought from. But I can't find external references to it easily:
At Google, the preference is for working in small teams of three, with individual employees expected to allot 20 percent of their time to exploring whatever ideas interest them most. The notion of "20 percent time" is borrowed from the academic world, where professors are given one day a week to pursue private interests.
Demo under: nodejs/sequelize/raw/many_to_many.js.
NO way in the SQL standard apparently, but you'd hope that implementation status would be similar to UPDATE with JOIN, but not even!
- PostgreSQL: possible with
DELETE FROM USING: stackoverflow.com/questions/11753904/postgresql-delete-with-inner-join - SQLite: not possible without subqueries as of 3.35 far: stackoverflow.com/questions/24511153/how-delete-table-inner-join-with-other-table-in-sqlite, Does not appear to have any relevant features at: www.sqlite.org/lang_delete.html
ORM
- Sequelize: no support of course: stackoverflow.com/questions/40890131/sequelize-destroy-record-with-join
Pinned article: Introduction to the OurBigBook Project
Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
Intro to OurBigBook
. Source. We have two killer features:
- topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculusArticles of different users are sorted by upvote within each article page. This feature is a bit like:
- a Wikipedia where each user can have their own version of each article
- a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.Figure 1. Screenshot of the "Derivative" topic page. View it live at: ourbigbook.com/go/topic/derivativeVideo 2. OurBigBook Web topics demo. Source. - local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
- to OurBigBook.com to get awesome multi-user features like topics and likes
- as HTML files to a static website, which you can host yourself for free on many external providers like GitHub Pages, and remain in full control
Figure 3. Visual Studio Code extension installation.Figure 4. Visual Studio Code extension tree navigation.Figure 5. Web editor. You can also edit articles on the Web editor without installing anything locally.Video 3. Edit locally and publish demo. Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension.Video 4. OurBigBook Visual Studio Code extension editing and navigation demo. Source. - Infinitely deep tables of contents:
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact





