---
title: "What are transactions and their controls?"  
description: "What are transactions and their controls?"  
author: "Ravi Vishwakarma"  
published: 2021-09-22  
updated: 2021-09-22  
canonical: https://www.mindstick.com/forum/156749/what-are-transactions-and-their-controls  
category: "database"  
tags: ["database", "mysql", "sql server", "sql"]  
reading_time: 2 minutes  

---

# What are transactions and their controls?

What are [transactions](https://www.mindstick.com/interview/864/explain-acid-rule-of-thumb-for-transactions) and their [controls](https://www.mindstick.com/articles/66/how-to-create-controls-at-run-time-in-csharp-dot-net)?

## Replies

### Reply by Krishnapriya Rajeev

Transactions are a group of database commands that can change or access data stored in a database. A transaction is considered a single unit of work and is known to maintain the integrity of data in the database.

Transaction control statements include:

1. **COMMIT:** The COMMIT command saves changes made by the transaction in the database.

## Syntax:

> *COMMIT;*

2. **ROLLBACK:** The ROLLBACK command is used to undo saved changes made by the transaction in the database.

## Syntax:

> *ROLLBACK;*

**3. SAVEPOINT:** SAVEPOINT is a point in the groups of transactions to roll back.

## Syntax:

> *SAVEPOINT savepoint_name;*

**4. SET TRANSACTION:** The SET TRANSACTION command is used to initiate a database transaction.

## Syntax:

> SET TRANSACTION [ READ WRITE | READ ONLY ];

### Reply by Ashutosh Kumar Verma

## SQL Transaction:

A transaction is a group of operations that are treated as just one logical operation.

For example: When we withdraw money from our bank account or deposit money in the bank account.

**Property of Transaction (ACID Properties) :-** Transaction has four properties which we call ACID Properties.

1-Atomicity

2-Consistency

3-Isolation

4-D-Durability

**1-Atomicity:-** When the transaction is completed in a single step then the transaction is atomic.

**2:-Consistency:-** When the transaction takes place, the database is consistence from one state to another.

**3:-Isolation:-** When two or more transactions are executed simultaneously, then one transaction does not affect the other transaction.

**4:-Durability:-** When a transaction is completely completed then the changes that take place stay in the system permanently. That is, the transaction should be durable.

Transaction Control:

The following commands are used to control the transaction-

1- COMMIT: This command is used to save the changes in database table.

2- ROLLBACK: It is used to roll back the changes.

3- SAVE POINT: It creates the points within the group of multiple transactions in which to rollback.

4- SET TRANSACTION: It place a name on a transaction.

\


---

Original Source: https://www.mindstick.com/forum/156749/what-are-transactions-and-their-controls

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
