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

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Continent" TEXT,
"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 ("CHN", "Asia", "1400000000");
INSERT INTO "country" VALUES ("IND", "Asia", "1380000000");
INSERT INTO "country" VALUES ("JPN", "Asia", "126000000");
INSERT INTO "country" VALUES ("USA", "North America", "331000000");
INSERT INTO "country" VALUES ("RUS", "Europe", "146000000");
INSERT INTO "country" VALUES ("SGP", "Asia", "5700000");
INSERT INTO "country" VALUES ("MYS", "Asia", "32000000");
INSERT INTO "country" VALUES ("FRA", "Europe", "67000000");
INSERT INTO "countrylanguage" VALUES ("CHN", "Chinese", "T", "92.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "T", "41.0");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "F", "12.0");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese", "T", "99.0");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "80.0");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian", "T", "85.0");
INSERT INTO "countrylanguage" VALUES ("SGP", "Chinese", "T", "35.0");
INSERT INTO "countrylanguage" VALUES ("SGP", "English", "T", "20.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Malay", "T", "60.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Chinese", "F", "25.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "88.0");
INSERT INTO "city" VALUES ("1", "Beijing", "CHN", "21500000");
INSERT INTO "city" VALUES ("2", "Shanghai", "CHN", "24200000");
INSERT INTO "city" VALUES ("3", "Guangzhou", "CHN", "14000000");
INSERT INTO "city" VALUES ("4", "Mumbai", "IND", "12400000");
INSERT INTO "city" VALUES ("5", "Delhi", "IND", "11000000");
INSERT INTO "city" VALUES ("6", "Tokyo", "JPN", "13900000");
INSERT INTO "city" VALUES ("7", "Osaka", "JPN", "2700000");
INSERT INTO "city" VALUES ("8", "New York", "USA", "8400000");
INSERT INTO "city" VALUES ("9", "Moscow", "RUS", "12000000");
INSERT INTO "city" VALUES ("10", "Singapore", "SGP", "5600000");
INSERT INTO "city" VALUES ("11", "Kuala Lumpur", "MYS", "1800000");
INSERT INTO "city" VALUES ("12", "George Town", "MYS", "700000");
INSERT INTO "city" VALUES ("13", "Lyon", "FRA", "500000");