DeveloperBreeze

Tutorials Programming Tutorials, Guides & Best Practices

Explore 148+ expertly crafted tutorials tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from DeveloperBreeze.

Managing Transactions and Concurrency in MySQL

Tutorial August 12, 2024
mysql

  • START TRANSACTION: Begins a new transaction.
  • COMMIT: Saves the changes made in the transaction permanently.
  • ROLLBACK: Reverts the changes made in the transaction.
START TRANSACTION;

INSERT INTO accounts (user_id, balance) VALUES (1, 100);

UPDATE accounts SET balance = balance - 50 WHERE user_id = 1;

COMMIT;

Viewing the Database Size and Identifying the Largest Table in MySQL

Tutorial August 12, 2024
mysql

Enter your password when prompted. Once logged in, you'll be able to execute SQL commands to query the database.

To view the size of a specific database, you'll query the information_schema.tables table. This table contains metadata about all the tables in your databases.