sql语句基础笔记
文章平均质量分 67
Crushhhh
这烈日
展开
-
sql语句---外键操作
添加外键alter table 表名 add constraint 外键名称 foreign key (外键字段名称) references 主表名称(主表列名);删除外键alter table 表名 drop foreign key 外键名称级联操作1.添加级联操作alter table 表名 add constraint 外键名称 foreign key (外键字段名称) re...原创 2019-10-10 19:55:41 · 998 阅读 · 0 评论 -
sql语句---表连接and子查询
内连接:隐式内连接:select 列名 from 表1,表2…where 连接条件显示内连接:1.select 列名 from 表1 inner join 表2 on 连接条件2.select 列名 from 表 join 表2 on 连接条件外连接:左连接:select 列名 form 表1 left 【out】 join 表2 on 连接条件**子查询:**...原创 2019-10-11 16:03:21 · 706 阅读 · 0 评论 -
sql语句--事务
开启事务—start transaction;sql操作-----------没有问题----commit提交事务提交事务—commit;出现问题-----rollback回滚事务;回滚事务—rollback;mysql数据库中事务默认提交set @@autocommit=0后;需要commit提交事务以致生效;...原创 2019-10-11 16:57:26 · 595 阅读 · 0 评论