<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      MySQL學(xué)習(xí)筆記-部分實(shí)例datagrip源碼-10-21

      show tables;
      create table user(
                    id int primary key auto_increment,
                    name varchar(10) not null unique,
                    age int check(age>0 and age<=120),
                    status char(1) default '1',
                    gender char(1)
      ) comment '用戶表';
      -- 添加數(shù)據(jù)
      insert into user(name, age, status, gender) values('張三', 20, '1', '1'), ('李四', 20, '0', '1');
      insert into user(name, age, status, gender) values('王五', 20, '1', '0');
      
      insert into user(name, age, status, gender) values(null, 20, '1', '0');
      insert into user(name, age, status, gender) values('王五', 20, '1', '0');
      insert into user(name, age, status, gender) values('小七', 80, '1', '0');
      insert into user(name, age, status, gender) values('小九', 121, '1', '0');
      insert into user(name, age, gender) values('小九', 120,'0');
      
      create table dept(
      id int auto_increment comment 'Io' primary key,
      name varchar(50)not null comment'部門名稱'
      )comment'部門表';
      INSERT INTo dept (id, name) VALUES(1,'研發(fā)部'),(2,'市場部'),(3,'財(cái)務(wù)部'),(4,'銷售部'),(5,'總經(jīng)辦');
      create table emp(
          id        int auto_increment comment 'ID' primary key,
          name      varchar(50) not null comment '姓名',
          age       int comment '年齡',
          job       varchar(20) comment '職位',
          salary    int comment '薪資',
          entrydate date comment '入職時間',
          managerid int comment '直屬領(lǐng)導(dǎo)ID',
          dept_id   int comment '部門ID'
      )comment'員工表';
      
      INSERT INTo emp (id, name, age, job,salary, entrydate, managerid, dept_id) VALUES
      (1,'金庸',66,'總裁',20000,'2080-01-01',null,5),
      (2,'張無忌',20,'項(xiàng)日經(jīng)理',12500,'2005-12-05',1,1),
      (3,'楊道',33,'開發(fā)',8400,'2000-11-03',2,1),
      (4,'韋一笑',48,'開發(fā)',11000,'2002-02-05',2,1),
      (5,'常遇春',43,'開發(fā)',10500,'2004-09-07',3,1),
      (6,'小昭',18,'程序員鼓勵師',6600,'2004-10-12',2,1);
      -- 添加外鍵
      alter table emp add constraint fk_emp_dept_id foreign key (dept_id) references dept(id);
      -- 刪除外鍵
      alter table emp drop foreign key fk_emp_dept_id;
      
      create table account(
      id int auto_increment primary key comment'主鍵ID',
          name varchar(10)comment'姓名',
          money int comment'余額comment"賬戶表'
                          );
      insert into account(id, name, money)VALUES (nuLl,'張三',2000),(null,'李四',2000);
      select @@autocommit;
      set @@autocommit = 1 ;
      update account set money = 2000 where name = '張三'or name = '李四';
      -- 轉(zhuǎn)賬操作(張三給李四轉(zhuǎn)賬1000)
      -- 1.查詢張三賬戶余顏
      select * from account where name ='張三';
      -- 2.將張三賬戶余額-1000
      update account set money=money-1000 where name ='張三';
      程序執(zhí)行報(bào)錯 ......
      -- 3.將李四賬戶余額+1000
      update account set money = money + 1000 where name ='李四';
      -- 事務(wù)提交
      commit;
      -- 事務(wù)回滾
      rollback;
      -- 方式二
      -- 轉(zhuǎn)賬操作(張三給李四轉(zhuǎn)賬1000)
      start transaction;
      -- 1.查詢張三賬戶余顏
      select * from account where name ='張三';
      -- 2.將張三賬戶余額-1000
      update account set money=money-1000 where name ='張三';
      程序執(zhí)行報(bào)錯 ......
      -- 3.將李四賬戶余額+1000
      update account set money = money + 1000 where name ='李四';
      -- 事務(wù)提交
      commit;
      -- 事務(wù)回滾
      rollback;
      -- 查看事務(wù)隔離級別
      select @@transaction_isolation;
      -- 設(shè)置事務(wù)隔離級別
      set session transaction isolation level read uncommitted;
      -- 設(shè)置事務(wù)默認(rèn)級別
      set session transaction isolation level repeatable read ;
      -- 1.事務(wù)簡介
      -- 事務(wù)是一組操作的集合,這組操作,要么全部執(zhí)行成功,要么全部執(zhí)行失敗。
      -- 2.事務(wù)操作
      -- START TRANSACTION;--開啟事務(wù)
      -- COMMIT/ROLLBACK;--提交/回滾事務(wù)
      -- 3.事務(wù)四大特性
      -- 原子性( Atomicity )、一致性( Consistency)、隔離性( Isolation)、持久性( Durability)
      -- 4.并發(fā)事務(wù)問題
      -- 贓讀、不可重復(fù)讀、幻讀
      -- 5.事務(wù)隔離級別
      -- READ UNCOMMITTED 、READ COMMITTED、 REPEATABLE READ、SERIALIZABLE

       

      posted @ 2025-10-24 08:59  十支穿云箭  閱讀(16)  評論(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 国产高清精品在线91| 国产中文字幕在线一区| 亚洲人成电影网站色mp4| 宝贝腿开大点我添添公视频免| 免费av深夜在线观看| 强插少妇视频一区二区三区| 妺妺窝人体色www看美女| 26uuu另类亚洲欧美日本| 国产精品露脸视频观看| 久9视频这里只有精品| 内射少妇一区27p| 和艳妇在厨房好爽在线观看| 亚洲精品无码成人A片九色播放| 大地资源网第二页免费观看| 91孕妇精品一区二区三区| 亚洲永久精品日韩成人av| 一区二区三区四区亚洲自拍| 樱花草视频www日本韩国| 成A人片亚洲日本久久| 综合图区亚洲欧美另类图片| 成人午夜国产内射主播| 国产精品播放一区二区三区| 欧美和黑人xxxx猛交视频| 天堂在/线中文在线资源 官网| 中文字幕乱码十国产乱码| 亚洲黄色一级片在线观看| 99久久精品久久久久久婷婷| 欧美不卡无线在线一二三区观| 国产91丝袜在线播放动漫| 日韩无套无码精品| 亚洲国产精品综合久久2007| 国产乱码精品一区二三区| 麻豆国产高清精品国在线| 国产成人无码专区| 成人国产精品中文字幕| 亚洲一级特黄大片在线播放| 亚洲中文字幕日产无码成人片| 国产在线午夜不卡精品影院| 九九色这里只有精品国产| 熟妇人妻av中文字幕老熟妇 | 欧美高清狂热视频60一70|