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,
"Continent" TEXT,
"Population" INT,
"GovernmentForm" CHAR(45),
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 "country" VALUES ("GBR", "Europe", "67000000", "Constitutional Monarchy");
INSERT INTO "country" VALUES ("FRA", "Europe", "67000000", "Republic");
INSERT INTO "country" VALUES ("ESP", "Europe", "47000000", "Constitutional Monarchy");
INSERT INTO "country" VALUES ("DEU", "Europe", "83000000", "Federal Republic");
INSERT INTO "country" VALUES ("ITA", "Europe", "60000000", "Republic");
INSERT INTO "country" VALUES ("NLD", "Europe", "17000000", "Constitutional Monarchy");
INSERT INTO "country" VALUES ("SWE", "Europe", "10000000", "Constitutional Monarchy");
INSERT INTO "country" VALUES ("USA", "North America", "330000000", "Federal Republic");
INSERT INTO "country" VALUES ("IND", "Asia", "1380000000", "Federal Republic");
INSERT INTO "country" VALUES ("RUS", "Europe", "144000000", "Federal Republic");
INSERT INTO "countrylanguage" VALUES ("GBR", "English", "T");
INSERT INTO "countrylanguage" VALUES ("GBR", "Welsh", "F");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T");
INSERT INTO "countrylanguage" VALUES ("FRA", "English", "F");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T");
INSERT INTO "countrylanguage" VALUES ("ESP", "Catalan", "F");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "T");
INSERT INTO "countrylanguage" VALUES ("DEU", "English", "F");
INSERT INTO "countrylanguage" VALUES ("ITA", "Italian", "T");
INSERT INTO "countrylanguage" VALUES ("NLD", "Dutch", "T");
INSERT INTO "countrylanguage" VALUES ("NLD", "English", "F");
INSERT INTO "countrylanguage" VALUES ("SWE", "Swedish", "T");
INSERT INTO "countrylanguage" VALUES ("SWE", "English", "F");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "T");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "T");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian", "T");
INSERT INTO "countrylanguage" VALUES ("RUS", "English", "F");
INSERT INTO "city" VALUES ("1", "London", "GBR", "8900000");
INSERT INTO "city" VALUES ("2", "Edinburgh", "GBR", "500000");
INSERT INTO "city" VALUES ("3", "Paris", "FRA", "2140000");
INSERT INTO "city" VALUES ("4", "Lyon", "FRA", "515000");
INSERT INTO "city" VALUES ("5", "Madrid", "ESP", "3200000");
INSERT INTO "city" VALUES ("6", "Barcelona", "ESP", "1600000");
INSERT INTO "city" VALUES ("7", "Berlin", "DEU", "3600000");
INSERT INTO "city" VALUES ("8", "Munich", "DEU", "1500000");
INSERT INTO "city" VALUES ("9", "Rome", "ITA", "2800000");
INSERT INTO "city" VALUES ("10", "Milan", "ITA", "1350000");
INSERT INTO "city" VALUES ("11", "Amsterdam", "NLD", "870000");
INSERT INTO "city" VALUES ("12", "Rotterdam", "NLD", "650000");
INSERT INTO "city" VALUES ("13", "Stockholm", "SWE", "975000");
INSERT INTO "city" VALUES ("14", "Gothenburg", "SWE", "580000");
INSERT INTO "city" VALUES ("15", "Moscow", "RUS", "12500000");
INSERT INTO "city" VALUES ("16", "Saint Petersburg", "RUS", "5350000");
INSERT INTO "city" VALUES ("17", "New York", "USA", "8400000");
INSERT INTO "city" VALUES ("18", "Los Angeles", "USA", "4000000");
INSERT INTO "city" VALUES ("19", "Delhi", "IND", "19000000");
INSERT INTO "city" VALUES ("20", "Mumbai", "IND", "12400000");