Transactions

From SQLZOO
Revision as of 15:47, 31 October 2016 by Andr3w (talk | contribs)
Jump to navigation Jump to search

BEGIN

  • Two sessions, with and without transactions
  • We create the bank of wealth - it has two customers, they both have £100
+--------+--------+
| cust   | amount |
+--------+--------+
| andrew |    100 |
| brian  |    100 |
+--------+--------+
DROP TABLE wealth;
CREATE TABLE wealth(
  cust VARCHAR(10) PRIMARY KEY,
  amount INT
);
INSERT INTO wealth VALUES ('andrew',100);
INSERT INTO wealth VALUES ('brian', 100);