Interview Question

What is ROLLBACK?

ROLLBACK discards uncommitted database changes.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

ROLLBACK ends the current transaction and discards its uncommitted changes. • It restores database effects to the transaction starting point. • A rollback to a savepoint can undo only later work. • External side effects outside the database are not automatically reversed.

💡 SQL Example

ROLLBACK;

Result

ROLLBACK

⚡ Quick Revision

ROLLBACK discards uncommitted database changes.