/*
A small example where natural joins make sense, to illustrate the
difference between inner joins and left/right/full outer joins.
*/

CREATE TABLE Capitals   (country TEXT,capital TEXT);
CREATE TABLE Currencies (country TEXT,currency TEXT);

INSERT INTO Capitals VALUES ('Sweden','Stockholm');
INSERT INTO Capitals VALUES ('Norway','Oslo');
INSERT INTO Capitals VALUES ('France','Paris');

INSERT INTO Currencies VALUES ('Sweden','SEK');
INSERT INTO Currencies VALUES ('Norway','NOK');
INSERT INTO Currencies VALUES ('Germany','EUR');

SELECT * FROM Capitals ;
SELECT * FROM Currencies ;

/* Inner join is the default, the INNER keyword can be omitted */
SELECT * FROM Capitals NATURAL INNER JOIN Currencies ;
SELECT * FROM Capitals NATURAL JOIN Currencies ;

/* Outer joins (the OUTER keyword can be omitted) */
SELECT * FROM Capitals NATURAL LEFT  OUTER JOIN Currencies ;
SELECT * FROM Capitals NATURAL RIGHT OUTER JOIN Currencies ;
SELECT * FROM Capitals NATURAL FULL  OUTER JOIN Currencies ;
