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

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Name" CHAR(52),
"Continent" TEXT,
"Region" CHAR(26),
PRIMARY KEY ("Code")
);

CREATE TABLE "countrylanguage" (
"CountryCode" CHAR(3),
"Language" CHAR(30),
"IsOfficial" TEXT,
"Percentage" FLOAT,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);





INSERT INTO "country" VALUES ("FRA", "France", "Europe", "Western Europe");
INSERT INTO "country" VALUES ("DEU", "Germany", "Europe", "Western Europe");
INSERT INTO "country" VALUES ("ESP", "Spain", "Europe", "Southern Europe");
INSERT INTO "country" VALUES ("ITA", "Italy", "Europe", "Southern Europe");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "Europe", "Northern Europe");
INSERT INTO "country" VALUES ("NLD", "Netherlands", "Europe", "Western Europe");
INSERT INTO "country" VALUES ("SWE", "Sweden", "Europe", "Northern Europe");
INSERT INTO "country" VALUES ("POL", "Poland", "Europe", "Eastern Europe");
INSERT INTO "country" VALUES ("RUS", "Russia", "Europe", "Eastern Europe");
INSERT INTO "country" VALUES ("TUR", "Turkey", "Europe", "Eastern Europe");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "88.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "English", "F", "15.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "English", "F", "56.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T", "90.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "English", "F", "12.0");
INSERT INTO "countrylanguage" VALUES ("ITA", "Italian", "T", "93.0");
INSERT INTO "countrylanguage" VALUES ("ITA", "English", "F", "10.0");
INSERT INTO "countrylanguage" VALUES ("GBR", "English", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("NLD", "Dutch", "T", "85.0");
INSERT INTO "countrylanguage" VALUES ("NLD", "English", "F", "90.0");
INSERT INTO "countrylanguage" VALUES ("SWE", "Swedish", "T", "85.0");
INSERT INTO "countrylanguage" VALUES ("SWE", "English", "F", "70.0");
INSERT INTO "countrylanguage" VALUES ("POL", "Polish", "T", "97.0");
INSERT INTO "countrylanguage" VALUES ("POL", "English", "F", "30.0");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("RUS", "English", "F", "20.0");
INSERT INTO "countrylanguage" VALUES ("TUR", "Turkish", "T", "85.0");
INSERT INTO "countrylanguage" VALUES ("TUR", "English", "F", "15.0");
INSERT INTO "city" VALUES ("1", "Paris", "FRA", "2148000");
INSERT INTO "city" VALUES ("2", "Lyon", "FRA", "515695");
INSERT INTO "city" VALUES ("3", "Berlin", "DEU", "3645000");
INSERT INTO "city" VALUES ("4", "Munich", "DEU", "1472000");
INSERT INTO "city" VALUES ("5", "Madrid", "ESP", "3223000");
INSERT INTO "city" VALUES ("6", "Barcelona", "ESP", "1620000");
INSERT INTO "city" VALUES ("7", "Rome", "ITA", "2873000");
INSERT INTO "city" VALUES ("8", "Milan", "ITA", "1366000");
INSERT INTO "city" VALUES ("9", "London", "GBR", "8908000");
INSERT INTO "city" VALUES ("10", "Manchester", "GBR", "553230");
INSERT INTO "city" VALUES ("11", "Amsterdam", "NLD", "872757");
INSERT INTO "city" VALUES ("12", "Rotterdam", "NLD", "651446");
INSERT INTO "city" VALUES ("13", "Stockholm", "SWE", "975904");
INSERT INTO "city" VALUES ("14", "Gothenburg", "SWE", "580000");
INSERT INTO "city" VALUES ("15", "Warsaw", "POL", "1790658");
INSERT INTO "city" VALUES ("16", "Krakow", "POL", "779115");
INSERT INTO "city" VALUES ("17", "Moscow", "RUS", "11920000");
INSERT INTO "city" VALUES ("18", "Saint Petersburg", "RUS", "5351935");
INSERT INTO "city" VALUES ("19", "Istanbul", "TUR", "15460000");
INSERT INTO "city" VALUES ("20", "Ankara", "TUR", "5445000");