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.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
1K views
MYSQL Assignments Final PDF
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.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
MYSQL DATABASE TRANSACTION ASSIGNMENT – 3
question : given below the mitem table.
icode iname iprice
101 chair 1500 102 dining table 24000
what will be the output
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;