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,
"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,
"LifeExpectancy" FLOAT,
PRIMARY KEY ("Code")
);

CREATE TABLE "countrylanguage" (
"CountryCode" CHAR(3),
"Language" CHAR(30),
"Percentage" FLOAT,
PRIMARY KEY ("CountryCode", "Language")
);





INSERT INTO "country" VALUES ("USA", "North America", "331000000", "78.9");
INSERT INTO "country" VALUES ("CAN", "North America", "38000000", "82.3");
INSERT INTO "country" VALUES ("MEX", "North America", "128000000", "75.0");
INSERT INTO "country" VALUES ("BRA", "South America", "212000000", "75.7");
INSERT INTO "country" VALUES ("ARG", "South America", "45000000", "76.7");
INSERT INTO "country" VALUES ("COL", "South America", "50000000", "71.5");
INSERT INTO "country" VALUES ("FRA", "Europe", "67000000", "82.5");
INSERT INTO "country" VALUES ("GER", "Europe", "83000000", "81.0");
INSERT INTO "country" VALUES ("ITA", "Europe", "60000000", "83.4");
INSERT INTO "country" VALUES ("NGA", "Africa", "206000000", "54.3");
INSERT INTO "country" VALUES ("EGY", "Africa", "102000000", "71.0");
INSERT INTO "country" VALUES ("ZAF", "Africa", "59000000", "64.1");
INSERT INTO "country" VALUES ("CHN", "Asia", "1402000000", "76.9");
INSERT INTO "country" VALUES ("IND", "Asia", "1380000000", "69.7");
INSERT INTO "country" VALUES ("PAK", "Asia", "220000000", "67.3");
INSERT INTO "country" VALUES ("AUS", "Oceania", "25000000", "83.0");
INSERT INTO "country" VALUES ("NZL", "Oceania", "5000000", "82.1");
INSERT INTO "city" VALUES ("1", "USA", "8800000");
INSERT INTO "city" VALUES ("2", "USA", "4300000");
INSERT INTO "city" VALUES ("3", "CAN", "2700000");
INSERT INTO "city" VALUES ("4", "MEX", "9200000");
INSERT INTO "city" VALUES ("5", "BRA", "12000000");
INSERT INTO "city" VALUES ("6", "ARG", "3000000");
INSERT INTO "city" VALUES ("7", "COL", "8000000");
INSERT INTO "city" VALUES ("8", "FRA", "2100000");
INSERT INTO "city" VALUES ("9", "GER", "3700000");
INSERT INTO "city" VALUES ("10", "ITA", "2800000");
INSERT INTO "city" VALUES ("11", "NGA", "14000000");
INSERT INTO "city" VALUES ("12", "EGY", "9500000");
INSERT INTO "city" VALUES ("13", "ZAF", "6000000");
INSERT INTO "city" VALUES ("14", "CHN", "24000000");
INSERT INTO "city" VALUES ("15", "IND", "18000000");
INSERT INTO "city" VALUES ("16", "PAK", "15000000");
INSERT INTO "city" VALUES ("17", "AUS", "5300000");
INSERT INTO "city" VALUES ("18", "NZL", "1600000");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "82.1");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "13.5");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "56.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "21.0");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "92.7");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "98.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish", "97.0");
INSERT INTO "countrylanguage" VALUES ("COL", "Spanish", "99.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "88.0");
INSERT INTO "countrylanguage" VALUES ("GER", "German", "95.0");
INSERT INTO "countrylanguage" VALUES ("ITA", "Italian", "93.0");
INSERT INTO "countrylanguage" VALUES ("NGA", "English", "53.0");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic", "90.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu", "23.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "9.6");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin", "70.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "41.0");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "12.0");
INSERT INTO "countrylanguage" VALUES ("PAK", "Urdu", "77.0");
INSERT INTO "countrylanguage" VALUES ("AUS", "English", "72.0");
INSERT INTO "countrylanguage" VALUES ("NZL", "English", "96.0");