8.10.30 下午 第68天上课

.8.10.30 下午 第68天上课

8.10.30 下午 第68天上课

 

8.10.30 下午 第68天上课

8.10.30 下午 第68天上课

8.10.30 下午 第68天上课

8.10.30 下午 第68天上课

8.10.30 下午 第68天上课

8.10.30 下午 第68天上课

8.10.30 下午 第68天上课

8.10.30 下午 第68天上课

create table tb_account
(
       accountId int primary key,
       accountName varchar2(20),
       amount int check(amount>=1) 
)

insert into tb_account(accountid,accountName,amount) values(1,'zhangsan',1000)
insert into tb_account(accountid,accountName,amount) values(2,'lisi',1)
--事务ACID特性
--1.原子性:一个事务中的所有操作是不可再分的最小单元(要么全部成功,要么全部失败)
--2.一致性:事务发生前后状态要保持一致
--3.隔离性:不同的事务之间相互隔离,互不影响
--4.持久性:一旦事务提交成功,数据将永久保存
select * from tb_account
--zhangsan和lisi转账1000元
update tb_account set amount=amount-1000 where accountId=1
update tb_account set amount=amount-1000 where accountId=2