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),
PRIMARY KEY ("ID")
);

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





INSERT INTO "city" VALUES ("1", "New York");
INSERT INTO "city" VALUES ("2", "Paris");
INSERT INTO "city" VALUES ("3", "Tokyo");
INSERT INTO "city" VALUES ("4", "Berlin");
INSERT INTO "city" VALUES ("5", "Madrid");
INSERT INTO "city" VALUES ("6", "Toronto");
INSERT INTO "city" VALUES ("7", "Sydney");
INSERT INTO "city" VALUES ("8", "Mexico City");
INSERT INTO "city" VALUES ("9", "Moscow");
INSERT INTO "city" VALUES ("10", "Cairo");
INSERT INTO "country" VALUES ("USA", "United States of America", "North America");
INSERT INTO "country" VALUES ("FRA", "France", "Europe");
INSERT INTO "country" VALUES ("JPN", "Japan", "Asia");
INSERT INTO "country" VALUES ("DEU", "Germany", "Europe");
INSERT INTO "country" VALUES ("ESP", "Spain", "Europe");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America");
INSERT INTO "country" VALUES ("AUS", "Australia", "Oceania");
INSERT INTO "country" VALUES ("MEX", "Mexico", "North America");
INSERT INTO "country" VALUES ("RUS", "Russia", "Europe");
INSERT INTO "country" VALUES ("EGY", "Egypt", "Africa");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T");
INSERT INTO "countrylanguage" VALUES ("FRA", "English", "F");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese", "T");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "T");
INSERT INTO "countrylanguage" VALUES ("DEU", "English", "F");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "F");
INSERT INTO "countrylanguage" VALUES ("AUS", "English", "T");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "T");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian", "T");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic", "T");
INSERT INTO "countrylanguage" VALUES ("EGY", "English", "F");