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),
"Name" CHAR(52),
"Region" CHAR(26),
"Population" INT,
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 ("USA", "United States of America", "North America", "331000000");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "Europe", "67000000");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America", "38000000");
INSERT INTO "country" VALUES ("AUS", "Australia", "Oceania", "25000000");
INSERT INTO "country" VALUES ("IND", "India", "Asia", "1380000000");
INSERT INTO "country" VALUES ("NGA", "Nigeria", "Africa", "206000000");
INSERT INTO "country" VALUES ("PHL", "Philippines", "Asia", "109000000");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "Africa", "59000000");
INSERT INTO "country" VALUES ("JAM", "Jamaica", "Caribbean", "3000000");
INSERT INTO "country" VALUES ("IRL", "Ireland", "Europe", "4900000");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "82.1");
INSERT INTO "countrylanguage" VALUES ("GBR", "English", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T", "56.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "T", "21.0");
INSERT INTO "countrylanguage" VALUES ("AUS", "English", "T", "97.0");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "F", "12.0");
INSERT INTO "countrylanguage" VALUES ("NGA", "English", "T", "53.0");
INSERT INTO "countrylanguage" VALUES ("PHL", "English", "T", "92.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "F", "9.6");
INSERT INTO "countrylanguage" VALUES ("JAM", "English", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("IRL", "English", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("IRL", "Irish", "T", "39.0");
INSERT INTO "city" VALUES ("1", "New York", "USA", "8419000");
INSERT INTO "city" VALUES ("2", "Los Angeles", "USA", "3980000");
INSERT INTO "city" VALUES ("3", "Chicago", "USA", "2716000");
INSERT INTO "city" VALUES ("4", "London", "GBR", "8982000");
INSERT INTO "city" VALUES ("5", "Birmingham", "GBR", "1141000");
INSERT INTO "city" VALUES ("6", "Toronto", "CAN", "2732000");
INSERT INTO "city" VALUES ("7", "Vancouver", "CAN", "631000");
INSERT INTO "city" VALUES ("8", "Sydney", "AUS", "5230000");
INSERT INTO "city" VALUES ("9", "Melbourne", "AUS", "5078000");
INSERT INTO "city" VALUES ("10", "Mumbai", "IND", "12440000");
INSERT INTO "city" VALUES ("11", "Lagos", "NGA", "14000000");
INSERT INTO "city" VALUES ("12", "Manila", "PHL", "1780000");
INSERT INTO "city" VALUES ("13", "Quezon City", "PHL", "2930000");
INSERT INTO "city" VALUES ("14", "Johannesburg", "ZAF", "957000");
INSERT INTO "city" VALUES ("15", "Cape Town", "ZAF", "433700");
INSERT INTO "city" VALUES ("16", "Kingston", "JAM", "580000");
INSERT INTO "city" VALUES ("17", "Dublin", "IRL", "1173000");
INSERT INTO "city" VALUES ("18", "Cork", "IRL", "210000");