exec-ddl
CREATE TABLE t.a (x INT PRIMARY KEY, y FLOAT)
----
table a
  x int NOT NULL
  y float NULL

exec-ddl
CREATE TABLE t.b (x INT, y FLOAT)
----
table b
  x int NULL
  y float NULL
  rowid int NOT NULL (hidden)

exec-ddl
CREATE TABLE t.c (x INT, y FLOAT, z VARCHAR, CONSTRAINT fk_x_ref_a FOREIGN KEY (x) REFERENCES t.a (x))
----
table c
  x int NULL
  y float NULL
  z string NULL
  rowid int NOT NULL (hidden)

build
SELECT * FROM t.a, t.b
----
project
 ├── columns: a.x:int:1 a.y:float:null:2 b.x:int:null:3 b.y:float:null:4
 ├── inner-join
 │    ├── columns: a.x:int:1 a.y:float:null:2 b.x:int:null:3 b.y:float:null:4 b.rowid:int:5
 │    ├── scan
 │    │    └── columns: a.x:int:1 a.y:float:null:2
 │    ├── scan
 │    │    └── columns: b.x:int:null:3 b.y:float:null:4 b.rowid:int:5
 │    └── true [type=bool]
 └── projections
      ├── variable: a.x [type=int]
      ├── variable: a.y [type=float]
      ├── variable: b.x [type=int]
      └── variable: b.y [type=float]

build
SELECT a.x, b.y FROM t.a, t.b WHERE a.x = b.x
----
project
 ├── columns: a.x:int:1 b.y:float:null:4
 ├── select
 │    ├── columns: a.x:int:1 a.y:float:null:2 b.x:int:null:3 b.y:float:null:4 b.rowid:int:5
 │    ├── inner-join
 │    │    ├── columns: a.x:int:1 a.y:float:null:2 b.x:int:null:3 b.y:float:null:4 b.rowid:int:5
 │    │    ├── scan
 │    │    │    └── columns: a.x:int:1 a.y:float:null:2
 │    │    ├── scan
 │    │    │    └── columns: b.x:int:null:3 b.y:float:null:4 b.rowid:int:5
 │    │    └── true [type=bool]
 │    └── eq [type=bool]
 │         ├── variable: a.x [type=int]
 │         └── variable: b.x [type=int]
 └── projections
      ├── variable: a.x [type=int]
      └── variable: b.y [type=float]

build
SELECT * FROM t.c, t.b, t.a WHERE c.x = a.x AND b.x = a.x
----
project
 ├── columns: c.x:int:null:1 c.y:float:null:2 c.z:string:null:3 b.x:int:null:5 b.y:float:null:6 a.x:int:8 a.y:float:null:9
 ├── select
 │    ├── columns: c.x:int:null:1 c.y:float:null:2 c.z:string:null:3 c.rowid:int:4 b.x:int:null:5 b.y:float:null:6 b.rowid:int:7 a.x:int:8 a.y:float:null:9
 │    ├── inner-join
 │    │    ├── columns: c.x:int:null:1 c.y:float:null:2 c.z:string:null:3 c.rowid:int:4 b.x:int:null:5 b.y:float:null:6 b.rowid:int:7 a.x:int:8 a.y:float:null:9
 │    │    ├── inner-join
 │    │    │    ├── columns: c.x:int:null:1 c.y:float:null:2 c.z:string:null:3 c.rowid:int:4 b.x:int:null:5 b.y:float:null:6 b.rowid:int:7
 │    │    │    ├── scan
 │    │    │    │    └── columns: c.x:int:null:1 c.y:float:null:2 c.z:string:null:3 c.rowid:int:4
 │    │    │    ├── scan
 │    │    │    │    └── columns: b.x:int:null:5 b.y:float:null:6 b.rowid:int:7
 │    │    │    └── true [type=bool]
 │    │    ├── scan
 │    │    │    └── columns: a.x:int:8 a.y:float:null:9
 │    │    └── true [type=bool]
 │    └── and [type=bool]
 │         ├── eq [type=bool]
 │         │    ├── variable: c.x [type=int]
 │         │    └── variable: a.x [type=int]
 │         └── eq [type=bool]
 │              ├── variable: b.x [type=int]
 │              └── variable: a.x [type=int]
 └── projections
      ├── variable: c.x [type=int]
      ├── variable: c.y [type=float]
      ├── variable: c.z [type=string]
      ├── variable: b.x [type=int]
      ├── variable: b.y [type=float]
      ├── variable: a.x [type=int]
      └── variable: a.y [type=float]
