O'Reilly logo

Mastering MariaDB by Federico Razzoli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Transactions and Locks

The SQL-99 specification defines transaction in this way:

"An SQL-transaction (transaction) is a sequence of executions of SQL-statements that is atomic with respect to recovery. That is to say: either the execution result is completely successful, or it has no effect on any SQL-schemas or SQL-data.

The SQL Standard"

So, a transaction is an important feature that guarantees the integrity of data. It is useful to prevent the data from remaining in an inconsistent state when an operation fails. Suppose, for example, we are administering a database for an e-commerce website. We have several tables; one of them stores the orders, and the others store the available products and their quantity. When a customer buys a product, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required