Transactions

From SQLZOO
Revision as of 14:46, 31 October 2016 by Andr3w (talk | contribs) (Created page with "*Two sessions, with and without transactions *We create the bank of wealth - it has two customers, they both have £100 +--------+--------+ | cust | amount | +--------+--...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • 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);