-- Two tables: Employee(id, name) and Sales(employeeID, productID)
-- The tables have the following content
-- (1,'John')        (1, 344)
-- (2,'Jane')        (2, 414)
-- (3,'Jack')        (2, 544)
-- If we run a simple join, Jack will not appear in the result
-- because she did not make any sells. 
-- If we run a left outer join, Jack will be returned with a null sale.
-- We can similarly do right joins and full outer joins (but not in sqlite)

-- Here is the example to run in sqlite:

CREATE TABLE Sales(employeeID int, productID int);
INSERT INTO Employee VALUES (1,'John');
INSERT INTO Employee VALUES (2,'Jane');
INSERT INTO Employee VALUES (3,'Jack');

INSERT INTO Sales VALUES (1,344);
INSERT INTO Sales VALUES (2,414);
INSERT INTO Sales VALUES (2,544);

-- The following will miss Jack
SELECT * FROM Employee E, Sales S WHERE E.id = S.employeeID;

-- This is the same as above but with a different syntax:
SELECT * FROM Employee E INNER JOIN Sales S ON E.id = S.employeeID;

-- The following will include Jack
SELECT * FROM Employee E LEFT OUTER JOIN Sales S ON E.id = S.employeeID;
