软考-系统架构设计师:关系代数
软考 系统架构设计师 大约 563 字基本运算
- 并
- 交
- 差
- 笛卡尔积
- 投影
- 选择
- 连接
用SQL表示
- 并集:
union
。
select id from table1 union select id from table2;
- 交集:
inner join on
。
select t1.id from table1 t1 inner join table2 t2 on t1.id = t2.id;
- 并集:
not in
。
select id from table1 where id not in (select id form table2);
- 笛卡尔积:
join
、inner join
、cross join
。
select * from table1, table2;
- 投影:选择必要字段,如
id
、name
。
select id, name, address from table1;
- 选择:
where
条件。
select * from table1 where id = 100;
- 连接:自动去除重复列,且不可使用
on
、using
。
natural join
、natural left join
、natural right join
select * from table1 natural join table2;
阅读 2138 · 发布于 2019-09-08
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
Spring Boot Thymeleaf 获取 Bean 等容器中的对象阅读 189
-
Rust 标准库 API 文件操作 File阅读 693
-
设计模式之命令模式阅读 1324
-
Ubuntu 卸载 Nginx阅读 1652
-
使用 trivy 扫描 Docker 镜像、K8S 集群的安全漏洞阅读 1576
-
Docker 部署 Swagger Editor阅读 791
-
Spring Boot 在拦截器中获取 Controller 中的注解阅读 1197
-
Spring Boot @Scheduled 定时任务阅读 4877
-
Android ContentProvider批量插入数据阅读 4104
-
Java G1 垃圾收集器开启字符串去重阅读 2137