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,
"Name" CHAR(52),
"Region" CHAR(26),
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 ("USA", "United States", "North America");
INSERT INTO "country" VALUES ("FRA", "France", "Europe");
INSERT INTO "country" VALUES ("CHN", "China", "Asia");
INSERT INTO "country" VALUES ("IND", "India", "Asia");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "Africa");
INSERT INTO "country" VALUES ("RUS", "Russia", "Europe");
INSERT INTO "country" VALUES ("ESP", "Spain", "Europe");
INSERT INTO "country" VALUES ("DEU", "Germany", "Europe");
INSERT INTO "country" VALUES ("JPN", "Japan", "Asia");
INSERT INTO "city" VALUES ("1", "USA");
INSERT INTO "city" VALUES ("2", "FRA");
INSERT INTO "city" VALUES ("3", "CHN");
INSERT INTO "city" VALUES ("4", "IND");
INSERT INTO "city" VALUES ("5", "BRA");
INSERT INTO "city" VALUES ("6", "ZAF");
INSERT INTO "city" VALUES ("7", "RUS");
INSERT INTO "city" VALUES ("8", "ESP");
INSERT INTO "city" VALUES ("9", "DEU");
INSERT INTO "city" VALUES ("10", "JPN");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish");
INSERT INTO "countrylanguage" VALUES ("FRA", "French");
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 ("BRA", "Portuguese");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Afrikaans");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish");
INSERT INTO "countrylanguage" VALUES ("DEU", "German");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese");
INSERT INTO "countrylanguage" VALUES ("IND", "Bengali");
INSERT INTO "countrylanguage" VALUES ("IND", "Tamil");
INSERT INTO "countrylanguage" VALUES ("CHN", "Shanghainese");