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),
"Population" INT,
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", "331000000");
INSERT INTO "country" VALUES ("CAN", "Canada", "38000000");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "67000000");
INSERT INTO "country" VALUES ("FRA", "France", "65000000");
INSERT INTO "country" VALUES ("DEU", "Germany", "83000000");
INSERT INTO "country" VALUES ("CHN", "China", "1440000000");
INSERT INTO "country" VALUES ("IND", "India", "1380000000");
INSERT INTO "country" VALUES ("JPN", "Japan", "126000000");
INSERT INTO "country" VALUES ("BRA", "Brazil", "213000000");
INSERT INTO "country" VALUES ("MEX", "Mexico", "128000000");
INSERT INTO "country" VALUES ("AUS", "Australia", "25000000");
INSERT INTO "country" VALUES ("NZL", "New Zealand", "5000000");
INSERT INTO "country" VALUES ("ESP", "Spain", "47000000");
INSERT INTO "country" VALUES ("ITA", "Italy", "59000000");
INSERT INTO "country" VALUES ("RUS", "Russia", "146000000");
INSERT INTO "country" VALUES ("ARG", "Argentina", "45000000");
INSERT INTO "country" VALUES ("EGY", "Egypt", "102000000");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "59000000");
INSERT INTO "country" VALUES ("NGA", "Nigeria", "206000000");
INSERT INTO "country" VALUES ("KOR", "South Korea", "51000000");
INSERT INTO "city" VALUES ("1", "USA", "8400000");
INSERT INTO "city" VALUES ("2", "CAN", "2900000");
INSERT INTO "city" VALUES ("3", "GBR", "8900000");
INSERT INTO "city" VALUES ("4", "FRA", "2100000");
INSERT INTO "city" VALUES ("5", "DEU", "3700000");
INSERT INTO "city" VALUES ("6", "CHN", "21000000");
INSERT INTO "city" VALUES ("7", "IND", "18000000");
INSERT INTO "city" VALUES ("8", "JPN", "14000000");
INSERT INTO "city" VALUES ("9", "BRA", "12000000");
INSERT INTO "city" VALUES ("10", "MEX", "9000000");
INSERT INTO "city" VALUES ("11", "AUS", "5300000");
INSERT INTO "city" VALUES ("12", "NZL", "1600000");
INSERT INTO "city" VALUES ("13", "ESP", "3300000");
INSERT INTO "city" VALUES ("14", "ITA", "2800000");
INSERT INTO "city" VALUES ("15", "RUS", "12000000");
INSERT INTO "city" VALUES ("16", "ARG", "3000000");
INSERT INTO "city" VALUES ("17", "EGY", "9800000");
INSERT INTO "city" VALUES ("18", "ZAF", "5500000");
INSERT INTO "city" VALUES ("19", "NGA", "14000000");
INSERT INTO "city" VALUES ("20", "KOR", "9700000");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish");
INSERT INTO "countrylanguage" VALUES ("CAN", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "French");
INSERT INTO "countrylanguage" VALUES ("GBR", "English");
INSERT INTO "countrylanguage" VALUES ("FRA", "French");
INSERT INTO "countrylanguage" VALUES ("DEU", "German");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi");
INSERT INTO "countrylanguage" VALUES ("IND", "English");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish");
INSERT INTO "countrylanguage" VALUES ("AUS", "English");
INSERT INTO "countrylanguage" VALUES ("NZL", "English");
INSERT INTO "countrylanguage" VALUES ("NZL", "Maori");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish");
INSERT INTO "countrylanguage" VALUES ("ITA", "Italian");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English");
INSERT INTO "countrylanguage" VALUES ("NGA", "Hausa");
INSERT INTO "countrylanguage" VALUES ("NGA", "English");
INSERT INTO "countrylanguage" VALUES ("KOR", "Korean");