直接学习:https://edu.csdn.net/course/play/27328/370709
事务控制
#1、什么是事务?
事务(transation)是作为一个逻辑工作单元执行的一系列操作,这些操作要么全部成功,要么全部失败,事务确保对多个数据的修改作为一个单元来处理。
#2、事务的四个特征:如果某个数据库声称支持事务,那么该数据库必须具备ACID四个特性,即原子性(Atomicity),一致性(Consistency),隔离性(Isolation)和持久性(Durability)。
第六章:MySQL高级进阶-事务控制

#3、代码示例:
select @@autocommit;
start transaction;
update bank_account set balance=balance-100 where id =1;
update bank_account set balance=balance+100 where id =2;
commit;

start transaction;
update bank_account set balance=balance-100 where id =1;
update bank_account set balance=balance+100 where id =2;
rollback;

相关文章:

  • 2021-07-22
  • 2022-01-01
  • 2022-12-23
  • 2021-07-08
  • 2021-05-23
  • 2022-12-23
  • 2021-10-13
  • 2021-11-08
猜你喜欢
  • 2021-07-30
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2021-07-11
  • 2021-10-18
相关资源
相似解决方案