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),
"District" CHAR(20),
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 ("VNM", "Asia");
INSERT INTO "country" VALUES ("USA", "North America");
INSERT INTO "country" VALUES ("BRA", "South America");
INSERT INTO "country" VALUES ("FRA", "Europe");
INSERT INTO "country" VALUES ("EGY", "Africa");
INSERT INTO "country" VALUES ("AUS", "Oceania");
INSERT INTO "city" VALUES ("1", "CHN", "Guangdong");
INSERT INTO "city" VALUES ("2", "CHN", "Beijing");
INSERT INTO "city" VALUES ("3", "IND", "Maharashtra");
INSERT INTO "city" VALUES ("4", "IND", "Delhi");
INSERT INTO "city" VALUES ("5", "JPN", "Kanto");
INSERT INTO "city" VALUES ("6", "KOR", "Seoul");
INSERT INTO "city" VALUES ("7", "VNM", "Hanoi");
INSERT INTO "city" VALUES ("8", "USA", "California");
INSERT INTO "city" VALUES ("9", "BRA", "Sao Paulo");
INSERT INTO "city" VALUES ("10", "FRA", "Ile-de-France");
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 ("VNM", "Vietnamese");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese");
INSERT INTO "countrylanguage" VALUES ("FRA", "French");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic");
INSERT INTO "countrylanguage" VALUES ("AUS", "English");