Acid Property with SQL Transactions

đź”· Introduction to ACID Properties in SQL Transactions

In SQL databases, a transaction is a sequence of one or more SQL operations (like INSERT, UPDATE, or DELETE) executed as a single unit of work.
To ensure the reliability and consistency of data, tr…


This content originally appeared on DEV Community and was authored by Kausi Tarun

đź”· Introduction to ACID Properties in SQL Transactions

In SQL databases, a transaction is a sequence of one or more SQL operations (like INSERT, UPDATE, or DELETE) executed as a single unit of work.
To ensure the reliability and consistency of data, transactions must follow the ACID properties.

1.Create a table Accounts(acc_no INT PRIMARY KEY, name VARCHAR(50), balance INT). Insert 3 sample rows.

2.Atomicity: Start a transaction that transfers money. Rollback midway → ensure no partial update remains.

3.Consistency: Try inserting a record with negative balance → should be rejected.

4.Isolation: Run two sessions at once – one updating, the other reading → observe isolation.

Durability: Commit a transaction → restart DB → ensure data persists.


This content originally appeared on DEV Community and was authored by Kausi Tarun


Print Share Comment Cite Upload Translate Updates
APA

Kausi Tarun | Sciencx (2025-10-08T14:48:11+00:00) Acid Property with SQL Transactions. Retrieved from https://www.scien.cx/2025/10/08/acid-property-with-sql-transactions/

MLA
" » Acid Property with SQL Transactions." Kausi Tarun | Sciencx - Wednesday October 8, 2025, https://www.scien.cx/2025/10/08/acid-property-with-sql-transactions/
HARVARD
Kausi Tarun | Sciencx Wednesday October 8, 2025 » Acid Property with SQL Transactions., viewed ,<https://www.scien.cx/2025/10/08/acid-property-with-sql-transactions/>
VANCOUVER
Kausi Tarun | Sciencx - » Acid Property with SQL Transactions. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/08/acid-property-with-sql-transactions/
CHICAGO
" » Acid Property with SQL Transactions." Kausi Tarun | Sciencx - Accessed . https://www.scien.cx/2025/10/08/acid-property-with-sql-transactions/
IEEE
" » Acid Property with SQL Transactions." Kausi Tarun | Sciencx [Online]. Available: https://www.scien.cx/2025/10/08/acid-property-with-sql-transactions/. [Accessed: ]
rf:citation
» Acid Property with SQL Transactions | Kausi Tarun | Sciencx | https://www.scien.cx/2025/10/08/acid-property-with-sql-transactions/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.