.echo on

CREATE TABLE T1 (
    v1 text,
    v2 text,
    id int
);

CREATE TABLE T2 (
    v1 text,
    v2 text,
    id int
);

INSERT INTO T1 VALUES("A1", "B1", 1);
INSERT INTO T1 VALUES("C1", "D1", 2);
INSERT INTO T1 VALUES("E1", "F1", 3);
INSERT INTO T1 VALUES("G1", "H1", 4);

INSERT INTO T2 VALUES("A2", "B2", 3);
INSERT INTO T2 VALUES("C2", "D2", 4);
INSERT INTO T2 VALUES("E2", "F2", 5);
INSERT INTO T2 VALUES("G2", "H2", 6);

SELECT T1.v1, T1.v2, T1.id, T2.id, T2.v1, T2.v2 FROM T1 LEFT JOIN T2 ON T1.id = T2.id;

SELECT T1.v1, T1.v2, T1.id, T2.id, T2.v1, T2.v2 FROM T1 LEFT JOIN T2 ON T1.id = T2.id WHERE T2.id IS NULL;

SELECT T1.v1, T1.v2, T1.id, T2.id, T2.v1, T2.v2 FROM T1 RIGHT JOIN T2 ON T1.id = T2.id;

SELECT T1.v1, T1.v2, T1.id, T2.id, T2.v1, T2.v2 FROM T1 RIGHT JOIN T2 ON T1.id = T2.id WHERE T1.id IS NULL;

SELECT T1.v1, T1.v2, T1.id, T2.id, T2.v1, T2.v2 FROM T1 INNER JOIN T2 ON T1.id = T2.id;

SELECT T1.v1, T1.v2, T1.id, T2.id, T2.v1, T2.v2 FROM T1 FULL OUTER JOIN T2 ON T1.id = T2.id;

SELECT T1.v1, T1.v2, T1.id, T2.id, T2.v1, T2.v2 FROM T1 FULL OUTER JOIN T2 ON T1.id = T2.id WHERE T1.id IS NULL OR T2.id IS NULL;

