CodingNic

Transactions

Module Overview

Transactions 5 min read

Module Overview

What You’ll Learn

  • Understand transactions
  • Maintain data consistency
  • Control database changes

💡 Why this module matters: Some changes only make sense as a group, transferring money between two accounts means both the withdrawal and the deposit have to succeed together, or not at all. Without transactions, a crash halfway through could leave data in a broken, half-changed state.

What’s Covered

  • ACID properties, the guarantees a transaction actually provides.
  • BEGIN, starting a transaction.
  • COMMIT, making every change in a transaction permanent.
  • ROLLBACK, undoing every change in a transaction.
  • SAVEPOINT, a checkpoint inside a transaction you can roll back to without undoing everything.

Hands-On

By the end of this module, you’ll perform a real account transfer as a transaction, roll back a transaction on purpose, and use savepoints to undo part of a transaction without losing all of it.

Next module is the capstone project, combining every module in this course into one complete, production-style database.