The document describes a transaction involving a MySQL mitem table with columns for item code, name, and price. It sets autocommit to 0, inserts a new row but doesn't commit, then rolls back to remove it. It starts a transaction, updates all prices by 200, sets a savepoint, updates prices by 400, rolls back to the savepoint to undo the last update, and selects data at each step. The transaction demonstrates how to group SQL statements together, rollback/commit changes, and use savepoints within a transaction.
The document describes a transaction involving a MySQL mitem table with columns for item code, name, and price. It sets autocommit to 0, inserts a new row but doesn't commit, then rolls back to remove it. It starts a transaction, updates all prices by 200, sets a savepoint, updates prices by 400, rolls back to the savepoint to undo the last update, and selects data at each step. The transaction demonstrates how to group SQL statements together, rollback/commit changes, and use savepoints within a transaction.
The document describes a transaction involving a MySQL mitem table with columns for item code, name, and price. It sets autocommit to 0, inserts a new row but doesn't commit, then rolls back to remove it. It starts a transaction, updates all prices by 200, sets a savepoint, updates prices by 400, rolls back to the savepoint to undo the last update, and selects data at each step. The transaction demonstrates how to group SQL statements together, rollback/commit changes, and use savepoints within a transaction.
The document describes a transaction involving a MySQL mitem table with columns for item code, name, and price. It sets autocommit to 0, inserts a new row but doesn't commit, then rolls back to remove it. It starts a transaction, updates all prices by 200, sets a savepoint, updates prices by 400, rolls back to the savepoint to undo the last update, and selects data at each step. The transaction demonstrates how to group SQL statements together, rollback/commit changes, and use savepoints within a transaction.
select * from mitem; set autocommit=0; insert into mitem values(103,’coffee table’,340); select * from mitem; rollback; select * from mitem; start transaction; update mitem set iprice=iprice+200; savepoint s1; update mitem set iprice=iprice+400; select * from mitem; rollback to s1; select * from mitem;