Learning Center
Learning Center
  • HTML
  • CSS
  • JAVASCRIPT
  • Bootstrap
  • React
  • jQuery
  • NodeJs
  • Sql
  • MySql
  • Python
  • OpenVPN Setup
  • Log In
Coding Choice Home About Contact ☰

  1. You are here
  2. Home
  3. sql
  4. transactions

Sidebar
  • Introduction
  • Getting Started
  • Querying Data
  • Joins
  • Stored Procedures
  • Transactions
  • Database Security
  • SQL Optimization
  • Share via
    • Share via...
    • Twitter
    • LinkedIn
    • Facebook
    • Pinterest
    • Telegram
    • WhatsApp
    • Yammer
    • Reddit
    • Teams
  • Send via e-Mail
  • Print
  • Permalink

Transactions

Transactions ensure data integrity by treating multiple SQL statements as a single unit.

Example: Using Transactions

START TRANSACTION;
UPDATE employees SET salary = 75000 WHERE id = 1;
COMMIT;

Example: Rolling Back a Transaction

START TRANSACTION;
DELETE FROM employees WHERE id = 2;
ROLLBACK;