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) UNIQUE,
"Name" CHAR(52),
"Region" CHAR(26),
"Population" INT,
PRIMARY KEY ("Code")
);

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





INSERT INTO "country" VALUES ("ESP", "Spain", "Europe", "47000000");
INSERT INTO "country" VALUES ("MEX", "Mexico", "North America", "126000000");
INSERT INTO "country" VALUES ("ARG", "Argentina", "South America", "45000000");
INSERT INTO "country" VALUES ("USA", "United States", "North America", "331000000");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America", "38000000");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America", "211000000");
INSERT INTO "country" VALUES ("GTM", "Guatemala", "Central America", "17000000");
INSERT INTO "country" VALUES ("BEL", "Belgium", "Europe", "11500000");
INSERT INTO "country" VALUES ("CHL", "Chile", "South America", "19000000");
INSERT INTO "country" VALUES ("PHL", "Philippines", "Asia", "108000000");
INSERT INTO "country" VALUES ("ECU", "Ecuador", "South America", "17000000");
INSERT INTO "country" VALUES ("COL", "Colombia", "South America", "50000000");
INSERT INTO "country" VALUES ("PRY", "Paraguay", "South America", "7000000");
INSERT INTO "country" VALUES ("VEN", "Venezuela", "South America", "28000000");
INSERT INTO "country" VALUES ("PER", "Peru", "South America", "32000000");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "98.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Catalan", "17.0");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "92.7");
INSERT INTO "countrylanguage" VALUES ("MEX", "Nahuatl", "1.5");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish", "97.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Italian", "1.5");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "80.0");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "13.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "58.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "22.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "98.0");
INSERT INTO "countrylanguage" VALUES ("GTM", "Spanish", "60.0");
INSERT INTO "countrylanguage" VALUES ("GTM", "Kiche", "20.0");
INSERT INTO "countrylanguage" VALUES ("BEL", "Dutch", "60.0");
INSERT INTO "countrylanguage" VALUES ("BEL", "French", "40.0");
INSERT INTO "countrylanguage" VALUES ("CHL", "Spanish", "99.0");
INSERT INTO "countrylanguage" VALUES ("PHL", "Filipino", "90.0");
INSERT INTO "countrylanguage" VALUES ("PHL", "English", "10.0");
INSERT INTO "countrylanguage" VALUES ("ECU", "Spanish", "93.0");
INSERT INTO "countrylanguage" VALUES ("COL", "Spanish", "99.0");
INSERT INTO "countrylanguage" VALUES ("PRY", "Spanish", "87.0");
INSERT INTO "countrylanguage" VALUES ("PRY", "Guarani", "88.0");
INSERT INTO "countrylanguage" VALUES ("VEN", "Spanish", "96.0");
INSERT INTO "countrylanguage" VALUES ("PER", "Spanish", "84.0");
INSERT INTO "countrylanguage" VALUES ("PER", "Quechua", "13.0");