Write Skew: The Anomaly the SQL Standard Forgot

· Luminousmen Blog · Sept. 8, 2026, 7:11 a.m.
Summary
Imagine the following scenario: a family credit account has a limit of $1000 a month, shared across both cards. The banking system enforces this limit in an obvious way. Before every purchase, count how much money has already been spent across both cards combined. If a new purchase is less than the remaining credit, allow it. Consider the following example, where at the very beginning of the month, one member of the family tries to make a $700 purchase: BEGIN; SELECT sum(balance_used) FROM car...