statement ok
CREATE TABLE t1 (id INT PRIMARY KEY, val INT);

statement ok
CREATE TABLE t2 (id INT PRIMARY KEY);

statement ok
INSERT INTO t1 VALUES (1, 10), (2, 20), (3, 30);

statement ok
INSERT INTO t2 VALUES (1), (3);

query II
SELECT id, val FROM t1 WHERE EXISTS (SELECT 1 FROM t2)
----
1 10
2 20
3 30

query II
SELECT id, val FROM t1 WHERE EXISTS (SELECT 1 FROM t2 WHERE 1 = 0)
----

query II
SELECT id, val FROM t1 WHERE NOT EXISTS (SELECT 1 FROM t2)
----


query II
SELECT id, val FROM t1 WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE 1 = 0)
----
1 10
2 20
3 30