PRAGMA foreign_keys = ON;

PRAGMA writable_schema = 1;
DELETE FROM sqlite_master WHERE type IN ("table", "index", "trigger");
PRAGMA writable_schema = 0;
VACUUM;

CREATE TABLE "city" (
"ID" INT,
"CountryCode" CHAR(3),
PRIMARY KEY ("ID"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Name" CHAR(52),
"Continent" TEXT,
PRIMARY KEY ("Code")
);

CREATE TABLE "countrylanguage" (
"CountryCode" CHAR(3),
"Language" CHAR(30),
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);





INSERT INTO "country" VALUES ("USA", "United States", "North America");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "Europe");
INSERT INTO "country" VALUES ("NLD", "Netherlands", "Europe");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America");
INSERT INTO "country" VALUES ("AUS", "Australia", "Oceania");
INSERT INTO "country" VALUES ("IND", "India", "Asia");
INSERT INTO "country" VALUES ("BEL", "Belgium", "Europe");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "Africa");
INSERT INTO "country" VALUES ("NZL", "New Zealand", "Oceania");
INSERT INTO "country" VALUES ("IRL", "Ireland", "Europe");
INSERT INTO "city" VALUES ("1", "USA");
INSERT INTO "city" VALUES ("2", "GBR");
INSERT INTO "city" VALUES ("3", "NLD");
INSERT INTO "city" VALUES ("4", "CAN");
INSERT INTO "city" VALUES ("5", "AUS");
INSERT INTO "city" VALUES ("6", "IND");
INSERT INTO "city" VALUES ("7", "BEL");
INSERT INTO "city" VALUES ("8", "ZAF");
INSERT INTO "city" VALUES ("9", "NZL");
INSERT INTO "city" VALUES ("10", "IRL");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("GBR", "English");
INSERT INTO "countrylanguage" VALUES ("NLD", "Dutch");
INSERT INTO "countrylanguage" VALUES ("CAN", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "French");
INSERT INTO "countrylanguage" VALUES ("AUS", "English");
INSERT INTO "countrylanguage" VALUES ("IND", "English");
INSERT INTO "countrylanguage" VALUES ("BEL", "Dutch");
INSERT INTO "countrylanguage" VALUES ("BEL", "French");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Afrikaans");
INSERT INTO "countrylanguage" VALUES ("NZL", "English");
INSERT INTO "countrylanguage" VALUES ("IRL", "English");
INSERT INTO "countrylanguage" VALUES ("IRL", "Irish");
INSERT INTO "countrylanguage" VALUES ("NLD", "English");
INSERT INTO "countrylanguage" VALUES ("BEL", "English");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish");
INSERT INTO "countrylanguage" VALUES ("GBR", "Welsh");
INSERT INTO "countrylanguage" VALUES ("AUS", "Aboriginal languages");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi");