Defining Transactions
As we have seen up to now, transactions are an essential building block for ACID-compliant systems. It is important to remember that transactions can either be single-statement transactions, for example:
INSERT INTO product_brand (id, label, description)
VALUES (10001, 'Wrangler Jeans', 'Good Mornings Make for Better Days');
or multi-statement transactions, such as
BEGIN;
INSERT INTO product_brand (id, label, description)
VALUES (10001, 'Wrangler Jeans', 'Good Mornings Make for Better Days');
INSERT INTO product (id, product_category_id, product_brand_id, label, shortdescription)
VALUES (10000, 1, 10001, 'Jeans by Wrangler', 'Best pants for a great day');
INSERT INTO product_variant (id, product_id, attributes, upc)
VALUES (10001, 10000, '{"color": "blue", "size": "32/36", "fit": "Boot Leg"}', '1234567890'...