Concept Notes (Deep Explanation + Examples)
1οΈβ£ Introduction: Why Transaction Control Matters in DBMS
In real-world databases (banks, exam portals, e-commerce sites), data safety is critical.
Imagine:
- Student paying ECET exam fee π³
- Bank deducts money β but registration not updated β
To avoid such issues, DBMS uses transactions with control commands:
- COMMIT
- ROLLBACK
- SAVEPOINT
π These are called Transaction Control Language (TCL) commands in SQL.
2οΈβ£ What is a Transaction? (From Basics)
A transaction is a group of SQL operations executed as one logical unit.
Example:
UPDATE accounts SET balance = balance - 1000 WHERE acc_no = 101;
UPDATE accounts SET balance = balance + 1000 WHERE acc_no = 202;π Both statements together form one transaction.
If one fails β whole transaction should fail.
This follows ACID properties:
- Atomicity
- Consistency
- Isolation
- Durability
3οΈβ£ COMMIT Command (Permanent Save)
πΉ Meaning:
COMMIT permanently saves all changes made during the transaction.
Once committed:
- Changes are written to disk
- Cannot be undone
πΉ Syntax:
COMMIT;πΉ Real-world Example:
π‘ Online exam submission
- Student submits answers
- Data stored permanently
- Even if system crashes β data remains
πΉ SQL Example:
UPDATE student SET marks = 85 WHERE roll_no = 10;
COMMIT;π After COMMIT, ROLLBACK will NOT work.
4οΈβ£ ROLLBACK Command (Undo Changes)
πΉ Meaning:
ROLLBACK undoes all changes made after the last COMMIT.
Used when:
- Error occurs
- User cancels operation
- System failure
πΉ Syntax:
ROLLBACK;πΉ Real-world Example:
π‘ ATM Transaction
- Money deducted
- Cash not received
- Transaction rolled back
πΉ SQL Example:
SAVEPOINT sp1;
ROLLBACK TO sp1;π Deleted row comes back!
π Works only before COMMIT.
5οΈβ£ SAVEPOINT Command (Partial Rollback)
πΉ Meaning:
SAVEPOINT creates a checkpoint inside a transaction.
You can rollback up to a savepoint, not the entire transaction.
πΉ Syntax:
SAVEPOINT sp1; ROLLBACK TO sp1;
πΉ Real-world Example:
π‘ Editing student record
- Update name β
- Update marks β wrong
- Rollback only marks update
πΉ SQL Example:
UPDATE student SET name = 'Ravi' WHERE roll_no = 15;
SAVEPOINT s1;
UPDATE student SET marks = 120 WHERE roll_no = 15;
ROLLBACK TO s1;
COMMIT;β Name updated
β Marks not updated
6οΈβ£ Diagram Explained in Words (Transaction Flow)
Think of a whiteboard:
- Write changes with chalk βοΈ
- Until COMMIT β changes are temporary
- COMMIT β take permanent photo πΈ
- ROLLBACK β erase board π§½
- SAVEPOINT β mark a checkpoint line π¦
7οΈβ£ ECET Exam Important Points β
β COMMIT makes changes permanent
β ROLLBACK undoes changes before COMMIT
β SAVEPOINT allows partial rollback
β TCL commands work with DML (INSERT, UPDATE, DELETE)
β DDL commands (CREATE, DROP) do implicit COMMIT
βοΈ Formulas (Plain LaTeX β No Boxes)
(DBMS topic β No mathematical formulas applicable)
π 10 MCQs (ECET + GATE Hybrid)
Q1. Which SQL command permanently saves a transaction?
A. ROLLBACK
B. SAVEPOINT
C. COMMIT
D. DELETE
Q2. ROLLBACK command can undo changes made after:
A. SAVEPOINT
B. COMMIT
C. DROP
D. SELECT
Q3. SAVEPOINT is used to:
A. End transaction
B. Delete table
C. Perform partial rollback
D. Commit changes
Q4. Which command creates a checkpoint in a transaction?
A. COMMIT
B. DELETE
C. SAVEPOINT
D. ROLLBACK
Q5. TCL commands work with which SQL commands?
A. DDL
B. DML
C. DCL
D. SELECT
Q6. Which of the following causes implicit COMMIT?
A. INSERT
B. UPDATE
C. CREATE
D. DELETE
Q7. After COMMIT, which command cannot undo changes?
A. SAVEPOINT
B. DELETE
C. ROLLBACK
D. SELECT
Q8. SAVEPOINT is valid until:
A. Server restart
B. ROLLBACK
C. COMMIT
D. SELECT
Q9. Which command undoes changes up to SAVEPOINT?
A. ROLLBACK
B. ROLLBACK TO SAVEPOINT
C. COMMIT
D. DELETE
Q10. TCL stands for:
A. Table Control Language
B. Transaction Control Language
C. Transfer Control Language
D. Technical Control Language
β Answer Key (WordPress Table β NO HTML)
Q No | Answer
1 | C
2 | A
3 | C
4 | C
5 | B
6 | C
7 | C
8 | C
9 | B
10 | B
π§ MCQ Explanations
Q1: COMMIT saves data permanently β
Others undo or manipulate data β
Q2: ROLLBACK can revert till last SAVEPOINT β
Not after COMMIT β
Q3: SAVEPOINT allows partial rollback β
Not for commit or delete β
Q4: SAVEPOINT creates transaction checkpoints β
Q5: TCL works only with DML commands β
Q6: DDL commands auto-commit β
Q7: After COMMIT, ROLLBACK fails β
Q8: SAVEPOINT removed after COMMIT β
Q9: ROLLBACK TO SAVEPOINT is correct β
Q10: Full form is Transaction Control Language β
π― Motivation (ECET 2026 Specific)
This topic appears every year in ECET from DBMS basics.
Mastering COMMITβROLLBACKβSAVEPOINT gives you:
- Easy 1β2 guaranteed marks
- Strong foundation for Transactions & Concurrency
- Confidence in SQL questions
π Consistent revision = Rank boost π
π² CTA (Fixed)
Join our ECET 2026 CSE WhatsApp Group for daily quizzes & study notes:
https://chat.whatsapp.com/GniYuv3CYVDKjPWEN086X9

