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,
"Name" CHAR(52),
"Continent" TEXT,
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", "China", "Asia");
INSERT INTO "country" VALUES ("JPN", "Japan", "Asia");
INSERT INTO "country" VALUES ("IND", "India", "Asia");
INSERT INTO "country" VALUES ("USA", "United States", "North America");
INSERT INTO "country" VALUES ("RUS", "Russia", "Europe");
INSERT INTO "country" VALUES ("SGP", "Singapore", "Asia");
INSERT INTO "country" VALUES ("MYS", "Malaysia", "Asia");
INSERT INTO "country" VALUES ("VNM", "Vietnam", "Asia");
INSERT INTO "country" VALUES ("KOR", "South Korea", "Asia");
INSERT INTO "country" VALUES ("TWN", "Taiwan", "Asia");
INSERT INTO "countrylanguage" VALUES ("CHN", "Chinese", "T", "92.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "Tibetan", "F", "0.5");
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 ("USA", "English", "T", "80.0");
INSERT INTO "countrylanguage" VALUES ("SGP", "Chinese", "T", "35.0");
INSERT INTO "countrylanguage" VALUES ("SGP", "English", "T", "30.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Malay", "T", "60.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Chinese", "F", "25.0");
INSERT INTO "countrylanguage" VALUES ("VNM", "Vietnamese", "T", "90.0");
INSERT INTO "countrylanguage" VALUES ("KOR", "Korean", "T", "99.0");
INSERT INTO "countrylanguage" VALUES ("TWN", "Chinese", "T", "98.0");
INSERT INTO "city" VALUES ("1", "Beijing", "CHN", "21540000");
INSERT INTO "city" VALUES ("2", "Shanghai", "CHN", "24240000");
INSERT INTO "city" VALUES ("3", "Guangzhou", "CHN", "13500000");
INSERT INTO "city" VALUES ("4", "Tokyo", "JPN", "37400068");
INSERT INTO "city" VALUES ("5", "Osaka", "JPN", "19200000");
INSERT INTO "city" VALUES ("6", "Mumbai", "IND", "20411000");
INSERT INTO "city" VALUES ("7", "Delhi", "IND", "16787941");
INSERT INTO "city" VALUES ("8", "New York", "USA", "18800000");
INSERT INTO "city" VALUES ("9", "Moscow", "RUS", "12500000");
INSERT INTO "city" VALUES ("10", "Singapore", "SGP", "5700000");
INSERT INTO "city" VALUES ("11", "Kuala Lumpur", "MYS", "1800000");
INSERT INTO "city" VALUES ("12", "Ho Chi Minh City", "VNM", "9000000");
INSERT INTO "city" VALUES ("13", "Seoul", "KOR", "9776000");
INSERT INTO "city" VALUES ("14", "Taipei", "TWN", "2700000");
INSERT INTO "city" VALUES ("15", "Chengdu", "CHN", "16330000");
INSERT INTO "city" VALUES ("16", "Hangzhou", "CHN", "10000000");
INSERT INTO "city" VALUES ("17", "Penang", "MYS", "700000");
INSERT INTO "city" VALUES ("18", "Nagoya", "JPN", "9200000");
INSERT INTO "city" VALUES ("19", "Taichung", "TWN", "2800000");
INSERT INTO "city" VALUES ("20", "Shenzhen", "CHN", "125283000");