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),
"IsOfficial" TEXT,
"Percentage" FLOAT,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);





INSERT INTO "country" VALUES ("USA", "United States", "North America", "331000000");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "Europe", "67000000");
INSERT INTO "country" VALUES ("FRA", "France", "Europe", "67000000");
INSERT INTO "country" VALUES ("ESP", "Spain", "Europe", "47000000");
INSERT INTO "country" VALUES ("CHN", "China", "Asia", "1400000000");
INSERT INTO "country" VALUES ("JPN", "Japan", "Asia", "126000000");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America", "211000000");
INSERT INTO "country" VALUES ("DEU", "Germany", "Europe", "83000000");
INSERT INTO "country" VALUES ("RUS", "Russia", "Europe", "144000000");
INSERT INTO "country" VALUES ("IND", "India", "Asia", "1380000000");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F", "13.0");
INSERT INTO "countrylanguage" VALUES ("GBR", "English", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "88.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "English", "F", "10.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T", "90.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Catalan", "F", "17.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin", "T", "70.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "English", "F", "1.0");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese", "T", "99.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian", "T", "85.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "T", "40.0");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "T", "12.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Bengali", "F", "8.0");