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,
"Name" CHAR(52),
"Continent" TEXT,
"Region" CHAR(26),
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 "city" VALUES ("1", "14000000");
INSERT INTO "city" VALUES ("2", "3500000");
INSERT INTO "city" VALUES ("3", "12000000");
INSERT INTO "city" VALUES ("4", "8000000");
INSERT INTO "city" VALUES ("5", "500000");
INSERT INTO "city" VALUES ("6", "2000000");
INSERT INTO "city" VALUES ("7", "1000000");
INSERT INTO "city" VALUES ("8", "3000000");
INSERT INTO "city" VALUES ("9", "4500000");
INSERT INTO "city" VALUES ("10", "600000");
INSERT INTO "country" VALUES ("CHN", "China", "Asia", "Eastern Asia");
INSERT INTO "country" VALUES ("JPN", "Japan", "Asia", "Eastern Asia");
INSERT INTO "country" VALUES ("IND", "India", "Asia", "Southern Asia");
INSERT INTO "country" VALUES ("KOR", "South Korea", "Asia", "Eastern Asia");
INSERT INTO "country" VALUES ("THA", "Thailand", "Asia", "Southeast Asia");
INSERT INTO "country" VALUES ("VNM", "Vietnam", "Asia", "Southeast Asia");
INSERT INTO "country" VALUES ("RUS", "Russia", "Europe", "Eastern Europe");
INSERT INTO "country" VALUES ("EGY", "Egypt", "Africa", "Northern Africa");
INSERT INTO "country" VALUES ("SGP", "Singapore", "Asia", "Southeast Asia");
INSERT INTO "country" VALUES ("MYS", "Malaysia", "Asia", "Southeast Asia");
INSERT INTO "countrylanguage" VALUES ("CHN", "Chinese", "T", "92.0");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese", "T", "99.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "T", "41.0");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "F", "12.0");
INSERT INTO "countrylanguage" VALUES ("KOR", "Korean", "T", "97.0");
INSERT INTO "countrylanguage" VALUES ("THA", "Thai", "T", "90.0");
INSERT INTO "countrylanguage" VALUES ("VNM", "Vietnamese", "T", "85.0");
INSERT INTO "countrylanguage" VALUES ("SGP", "English", "T", "36.0");
INSERT INTO "countrylanguage" VALUES ("SGP", "Chinese", "F", "29.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Malay", "T", "60.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "English", "F", "20.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Chinese", "F", "10.0");