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,
"Population" INT,
PRIMARY KEY ("ID")
);

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Continent" TEXT,
"Region" CHAR(26),
"Capital" 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 "city" VALUES ("1", "14000000");
INSERT INTO "city" VALUES ("2", "9000000");
INSERT INTO "city" VALUES ("3", "3000000");
INSERT INTO "city" VALUES ("4", "500000");
INSERT INTO "city" VALUES ("5", "12000000");
INSERT INTO "city" VALUES ("6", "8000000");
INSERT INTO "city" VALUES ("7", "2000000");
INSERT INTO "city" VALUES ("8", "1000000");
INSERT INTO "city" VALUES ("9", "4000000");
INSERT INTO "city" VALUES ("10", "600000");
INSERT INTO "country" VALUES ("CHN", "Asia", "Eastern Asia", "1");
INSERT INTO "country" VALUES ("TWN", "Asia", "Eastern Asia", "2");
INSERT INTO "country" VALUES ("SGP", "Asia", "Southeast Asia", "3");
INSERT INTO "country" VALUES ("MYS", "Asia", "Southeast Asia", "4");
INSERT INTO "country" VALUES ("USA", "North America", "Northern America", "5");
INSERT INTO "country" VALUES ("CAN", "North America", "Northern America", "6");
INSERT INTO "country" VALUES ("FRA", "Europe", "Western Europe", "7");
INSERT INTO "country" VALUES ("DEU", "Europe", "Western Europe", "8");
INSERT INTO "country" VALUES ("ZAF", "Africa", "Southern Africa", "9");
INSERT INTO "country" VALUES ("EGY", "Africa", "Northern Africa", "10");
INSERT INTO "country" VALUES ("AUS", "Oceania", "Australia and New Zealand", "11");
INSERT INTO "country" VALUES ("NZL", "Oceania", "Australia and New Zealand", "12");
INSERT INTO "countrylanguage" VALUES ("CHN", "Chinese");
INSERT INTO "countrylanguage" VALUES ("TWN", "Chinese");
INSERT INTO "countrylanguage" VALUES ("SGP", "Chinese");
INSERT INTO "countrylanguage" VALUES ("MYS", "Malay");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "English");
INSERT INTO "countrylanguage" VALUES ("FRA", "French");
INSERT INTO "countrylanguage" VALUES ("DEU", "German");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic");
INSERT INTO "countrylanguage" VALUES ("AUS", "English");
INSERT INTO "countrylanguage" VALUES ("NZL", "English");