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 "country" (
"Code" CHAR(3),
"Name" CHAR(52),
"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", "331000000");
INSERT INTO "country" VALUES ("CAN", "Canada", "38000000");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "67000000");
INSERT INTO "country" VALUES ("AUS", "Australia", "25000000");
INSERT INTO "country" VALUES ("FRA", "France", "65000000");
INSERT INTO "country" VALUES ("DEU", "Germany", "83000000");
INSERT INTO "country" VALUES ("JPN", "Japan", "126000000");
INSERT INTO "country" VALUES ("CHN", "China", "1440000000");
INSERT INTO "country" VALUES ("IND", "India", "1380000000");
INSERT INTO "country" VALUES ("BRA", "Brazil", "213000000");
INSERT INTO "country" VALUES ("MEX", "Mexico", "128000000");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "59000000");
INSERT INTO "country" VALUES ("EGY", "Egypt", "102000000");
INSERT INTO "country" VALUES ("ARG", "Argentina", "45000000");
INSERT INTO "country" VALUES ("NLD", "Netherlands", "17000000");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "82.1");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F", "13.4");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T", "58.7");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "T", "22.0");
INSERT INTO "countrylanguage" VALUES ("GBR", "English", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("AUS", "English", "T", "80.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "96.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "German", "F", "1.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "T", "91.5");
INSERT INTO "countrylanguage" VALUES ("DEU", "Turkish", "F", "2.5");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese", "T", "99.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin", "T", "70.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "Cantonese", "F", "5.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "T", "41.0");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "F", "12.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "T", "97.0");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "T", "92.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu", "T", "22.7");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "T", "9.6");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic", "T", "99.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("NLD", "Dutch", "T", "90.0");
INSERT INTO "countrylanguage" VALUES ("NLD", "English", "F", "2.0");