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

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Region" CHAR(26),
"Population" INT,
"LifeExpectancy" FLOAT,
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", "5000000");
INSERT INTO "city" VALUES ("2", "12000000");
INSERT INTO "city" VALUES ("3", "800000");
INSERT INTO "city" VALUES ("4", "3000000");
INSERT INTO "city" VALUES ("5", "15000000");
INSERT INTO "city" VALUES ("6", "4500000");
INSERT INTO "city" VALUES ("7", "700000");
INSERT INTO "city" VALUES ("8", "2000000");
INSERT INTO "country" VALUES ("USA", "North America", "331000000", "78.9");
INSERT INTO "country" VALUES ("GBR", "Europe", "67000000", "81.2");
INSERT INTO "country" VALUES ("FRA", "Europe", "67000000", "82.5");
INSERT INTO "country" VALUES ("JPN", "Asia", "126000000", "84.3");
INSERT INTO "country" VALUES ("BRA", "South America", "211000000", "75.7");
INSERT INTO "country" VALUES ("IND", "Asia", "1380000000", "69.4");
INSERT INTO "country" VALUES ("ESP", "Europe", "47000000", "83.4");
INSERT INTO "country" VALUES ("NGA", "Africa", "206000000", "54.3");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F");
INSERT INTO "countrylanguage" VALUES ("GBR", "English", "T");
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 ("BRA", "Portuguese", "T");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "T");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "F");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T");
INSERT INTO "countrylanguage" VALUES ("NGA", "English", "F");
INSERT INTO "countrylanguage" VALUES ("NGA", "Hausa", "T");