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,
"Region" CHAR(26),
"Population" INT,
PRIMARY KEY ("Code")
);

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





INSERT INTO "country" VALUES ("USA", "North America", "331000000");
INSERT INTO "country" VALUES ("NLD", "Europe", "17400000");
INSERT INTO "country" VALUES ("CAN", "North America", "38000000");
INSERT INTO "country" VALUES ("BEL", "Europe", "11500000");
INSERT INTO "country" VALUES ("SUR", "South America", "600000");
INSERT INTO "country" VALUES ("ZAF", "Africa", "60000000");
INSERT INTO "country" VALUES ("IND", "Asia", "1380000000");
INSERT INTO "country" VALUES ("AUS", "Oceania", "25000000");
INSERT INTO "country" VALUES ("JAM", "North America", "3000000");
INSERT INTO "country" VALUES ("FRA", "Europe", "67000000");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("NLD", "Dutch", "T", "90.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T", "60.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "T", "23.0");
INSERT INTO "countrylanguage" VALUES ("BEL", "Dutch", "T", "60.0");
INSERT INTO "countrylanguage" VALUES ("BEL", "French", "T", "40.0");
INSERT INTO "countrylanguage" VALUES ("SUR", "Dutch", "T", "60.0");
INSERT INTO "countrylanguage" VALUES ("SUR", "English", "F", "10.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "T", "10.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Afrikaans", "T", "13.0");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "F", "12.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "T", "40.0");
INSERT INTO "countrylanguage" VALUES ("AUS", "English", "T", "85.0");
INSERT INTO "countrylanguage" VALUES ("JAM", "English", "T", "90.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "95.0");
INSERT INTO "city" VALUES ("1", "USA", "8800000");
INSERT INTO "city" VALUES ("2", "USA", "4300000");
INSERT INTO "city" VALUES ("3", "NLD", "870000");
INSERT INTO "city" VALUES ("4", "NLD", "1700000");
INSERT INTO "city" VALUES ("5", "CAN", "2700000");
INSERT INTO "city" VALUES ("6", "CAN", "1400000");
INSERT INTO "city" VALUES ("7", "BEL", "1200000");
INSERT INTO "city" VALUES ("8", "SUR", "240000");
INSERT INTO "city" VALUES ("9", "ZAF", "3500000");
INSERT INTO "city" VALUES ("10", "IND", "18000000");
INSERT INTO "city" VALUES ("11", "AUS", "5000000");
INSERT INTO "city" VALUES ("12", "JAM", "600000");
INSERT INTO "city" VALUES ("13", "FRA", "2100000");