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),
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),
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);





INSERT INTO "country" VALUES ("CHN", "China", "Asia");
INSERT INTO "country" VALUES ("SGP", "Singapore", "Asia");
INSERT INTO "country" VALUES ("MYS", "Malaysia", "Asia");
INSERT INTO "country" VALUES ("TWN", "Taiwan", "Asia");
INSERT INTO "country" VALUES ("USA", "United States", "North America");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America");
INSERT INTO "country" VALUES ("AUS", "Australia", "Oceania");
INSERT INTO "country" VALUES ("NZL", "New Zealand", "Oceania");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "Europe");
INSERT INTO "country" VALUES ("FRA", "France", "Europe");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America");
INSERT INTO "country" VALUES ("ARG", "Argentina", "South America");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "Africa");
INSERT INTO "country" VALUES ("EGY", "Egypt", "Africa");
INSERT INTO "city" VALUES ("1", "Beijing", "CHN");
INSERT INTO "city" VALUES ("2", "Shanghai", "CHN");
INSERT INTO "city" VALUES ("3", "Singapore", "SGP");
INSERT INTO "city" VALUES ("4", "Kuala Lumpur", "MYS");
INSERT INTO "city" VALUES ("5", "Taipei", "TWN");
INSERT INTO "city" VALUES ("6", "New York", "USA");
INSERT INTO "city" VALUES ("7", "Toronto", "CAN");
INSERT INTO "city" VALUES ("8", "Sydney", "AUS");
INSERT INTO "city" VALUES ("9", "Auckland", "NZL");
INSERT INTO "city" VALUES ("10", "London", "GBR");
INSERT INTO "city" VALUES ("11", "Paris", "FRA");
INSERT INTO "city" VALUES ("12", "Rio de Janeiro", "BRA");
INSERT INTO "city" VALUES ("13", "Buenos Aires", "ARG");
INSERT INTO "city" VALUES ("14", "Cape Town", "ZAF");
INSERT INTO "city" VALUES ("15", "Cairo", "EGY");
INSERT INTO "countrylanguage" VALUES ("CHN", "Chinese");
INSERT INTO "countrylanguage" VALUES ("SGP", "Chinese");
INSERT INTO "countrylanguage" VALUES ("SGP", "English");
INSERT INTO "countrylanguage" VALUES ("MYS", "Malay");
INSERT INTO "countrylanguage" VALUES ("MYS", "Chinese");
INSERT INTO "countrylanguage" VALUES ("TWN", "Chinese");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish");
INSERT INTO "countrylanguage" VALUES ("USA", "Chinese");
INSERT INTO "countrylanguage" VALUES ("CAN", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "French");
INSERT INTO "countrylanguage" VALUES ("AUS", "English");
INSERT INTO "countrylanguage" VALUES ("NZL", "English");
INSERT INTO "countrylanguage" VALUES ("GBR", "English");
INSERT INTO "countrylanguage" VALUES ("FRA", "French");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Afrikaans");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic");
INSERT INTO "countrylanguage" VALUES ("CAN", "Chinese");
INSERT INTO "countrylanguage" VALUES ("AUS", "Chinese");
INSERT INTO "countrylanguage" VALUES ("NZL", "Chinese");