Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker 诊断工具


软考-系统架构设计师:关系代数

软考 系统架构设计师 大约 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);
  • 笛卡尔积:joininner joincross join
select * from table1, table2;
  • 投影:选择必要字段,如idname
select id, name, address from table1;
  • 选择:where条件。
select * from table1 where id = 100;
  • 连接:自动去除重复列,且不可使用onusing

natural joinnatural left joinnatural right join

select * from table1 natural join table2;
阅读 2138 · 发布于 2019-09-08

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb

扫描下方二维码关注公众号和小程序↓↓↓

扫描二维码关注我
昵称:
随便看看 换一批