Rudolf Adamkovič Personal site


Example: Propagating updates

PRAGMA foreign_keys = ON;
CREATE TABLE t(k PRIMARY KEY, x);
CREATE TABLE u(k, x, FOREIGN KEY(k) REFERENCES t(k) ON UPDATE CASCADE);
INSERT INTO t(k, x) VALUES (10, 100);
INSERT INTO u(k, x) VALUES (10, 200);
UPDATE t SET k = 20;
SELECT k from u;
k
20

© 2025 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and secret alien technologies of yesteryear.