create table R(A INTEGER, B INTEGER); create table S(C INTEGER, D INTEGER); insert into R values('a', '1'); insert into R values('b', '2'); insert into R values('c', '3'); insert into S values('1', 'e'); insert into S values('2', 'f'); insert into S values('2', 'g'); insert into S values('4', 'h'); /********************** Set Operations **********************/ /*** Left Outer Join ****/ /* Includes all rows from the first table, matched or not, plus matching “pieces” from the second table, where applicable. For the rows of the first table that have no matches in the second table, NULLs are added for the columns of the second table */ /* SELECT * FROM R LEFT OUTER JOIN S ON R.B = S.C; */ /*** Right Outer Join ****/ /* Includes all rows from the second table, matched or not, plus matching “pieces” from the first table, where applicable. For the rows of the second table that have no matches in the first table, NULLs are added for the columns of the second table Not supported in sqlite */ /* SELECT * FROM R RIGHT OUTER JOIN S ON R.B = S.C; */ /*** FULL Outer Join ****/ /* COmbines the results of the LEFT and RIGHT joins For the rows of the second table that have no matches in the first table, NULLs are added for the columns of the second table Not supported in sqlite */ /* SELECT * FROM R FULL OUTER JOIN S ON R.B = S.C; */