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),
"Population" INT,
PRIMARY KEY ("ID"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);

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

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





INSERT INTO "country" VALUES ("NLD", "Netherlands", "Europe");
INSERT INTO "country" VALUES ("USA", "United States", "North America");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "Europe");
INSERT INTO "country" VALUES ("BEL", "Belgium", "Europe");
INSERT INTO "country" VALUES ("SUR", "Suriname", "South America");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America");
INSERT INTO "country" VALUES ("FRA", "France", "Europe");
INSERT INTO "country" VALUES ("DEU", "Germany", "Europe");
INSERT INTO "country" VALUES ("AUS", "Australia", "Oceania");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "Africa");
INSERT INTO "countrylanguage" VALUES ("NLD", "Dutch", "T");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T");
INSERT INTO "countrylanguage" VALUES ("GBR", "English", "T");
INSERT INTO "countrylanguage" VALUES ("BEL", "Dutch", "T");
INSERT INTO "countrylanguage" VALUES ("BEL", "French", "T");
INSERT INTO "countrylanguage" VALUES ("SUR", "Dutch", "T");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "F");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "T");
INSERT INTO "countrylanguage" VALUES ("AUS", "English", "T");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "T");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Afrikaans", "F");
INSERT INTO "city" VALUES ("1", "NLD", "821752");
INSERT INTO "city" VALUES ("2", "USA", "8804190");
INSERT INTO "city" VALUES ("3", "GBR", "8982000");
INSERT INTO "city" VALUES ("4", "BEL", "1216000");
INSERT INTO "city" VALUES ("5", "SUR", "240000");
INSERT INTO "city" VALUES ("6", "CAN", "2731571");
INSERT INTO "city" VALUES ("7", "FRA", "2148000");
INSERT INTO "city" VALUES ("8", "DEU", "3769000");
INSERT INTO "city" VALUES ("9", "AUS", "5312163");
INSERT INTO "city" VALUES ("10", "ZAF", "433688");
INSERT INTO "city" VALUES ("11", "ZAF", "433688");
INSERT INTO "city" VALUES ("12", "BEL", "260000");
INSERT INTO "city" VALUES ("13", "NLD", "1744000");
INSERT INTO "city" VALUES ("14", "USA", "3980400");
INSERT INTO "city" VALUES ("15", "GBR", "890000");