0% 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.

Uploaded by

Ghanshyam Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% 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.

Uploaded by

Ghanshyam Sharma
Copyright
© © All Rights Reserved
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;

FIRST FLOOR, OPPOSITE BANK OF BARODA,


AJMER ROAD, KISHANGARH (RAJ) 305801 CALL : +91 98291-71122
EMAIL : infotechcomputer@gmail.com | WEBSITE : www.infotechcomputer.in

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy