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

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"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", "Asia");
INSERT INTO "country" VALUES ("IND", "Asia");
INSERT INTO "country" VALUES ("JPN", "Asia");
INSERT INTO "country" VALUES ("KOR", "Asia");
INSERT INTO "country" VALUES ("THA", "Asia");
INSERT INTO "country" VALUES ("FRA", "Europe");
INSERT INTO "country" VALUES ("USA", "North America");
INSERT INTO "country" VALUES ("BRA", "South America");
INSERT INTO "country" VALUES ("AUS", "Oceania");
INSERT INTO "country" VALUES ("EGY", "Africa");
INSERT INTO "city" VALUES ("1", "CHN");
INSERT INTO "city" VALUES ("2", "CHN");
INSERT INTO "city" VALUES ("3", "IND");
INSERT INTO "city" VALUES ("4", "JPN");
INSERT INTO "city" VALUES ("5", "KOR");
INSERT INTO "city" VALUES ("6", "THA");
INSERT INTO "city" VALUES ("7", "FRA");
INSERT INTO "city" VALUES ("8", "USA");
INSERT INTO "city" VALUES ("9", "BRA");
INSERT INTO "city" VALUES ("10", "AUS");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin");
INSERT INTO "countrylanguage" VALUES ("CHN", "Cantonese");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi");
INSERT INTO "countrylanguage" VALUES ("IND", "English");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese");
INSERT INTO "countrylanguage" VALUES ("KOR", "Korean");
INSERT INTO "countrylanguage" VALUES ("THA", "Thai");
INSERT INTO "countrylanguage" VALUES ("FRA", "French");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese");
INSERT INTO "countrylanguage" VALUES ("AUS", "English");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic");