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),
PRIMARY KEY ("ID"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Name" CHAR(52),
"Region" CHAR(26),
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 ("USA", "United States", "North America");
INSERT INTO "country" VALUES ("FRA", "France", "Europe");
INSERT INTO "country" VALUES ("JPN", "Japan", "Asia");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America");
INSERT INTO "country" VALUES ("IND", "India", "Asia");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America");
INSERT INTO "country" VALUES ("DEU", "Germany", "Europe");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "Africa");
INSERT INTO "country" VALUES ("RUS", "Russia", "Europe");
INSERT INTO "country" VALUES ("ESP", "Spain", "Europe");
INSERT INTO "city" VALUES ("1", "USA");
INSERT INTO "city" VALUES ("2", "FRA");
INSERT INTO "city" VALUES ("3", "JPN");
INSERT INTO "city" VALUES ("4", "BRA");
INSERT INTO "city" VALUES ("5", "IND");
INSERT INTO "city" VALUES ("6", "CAN");
INSERT INTO "city" VALUES ("7", "DEU");
INSERT INTO "city" VALUES ("8", "ZAF");
INSERT INTO "city" VALUES ("9", "RUS");
INSERT INTO "city" VALUES ("10", "ESP");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "82.1");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "13.5");
INSERT INTO "countrylanguage" VALUES ("USA", "Chinese", "1.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "88.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "Arabic", "7.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "English", "3.0");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese", "99.0");
INSERT INTO "countrylanguage" VALUES ("JPN", "English", "1.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "97.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Spanish", "2.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "41.0");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "12.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Bengali", "8.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Telugu", "7.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "58.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "22.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "Chinese", "3.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "95.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "Turkish", "2.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu", "24.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Xhosa", "16.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Afrikaans", "13.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "9.0");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian", "85.0");
INSERT INTO "countrylanguage" VALUES ("RUS", "Tatar", "3.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "74.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Catalan", "17.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Galician", "7.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Basque", "2.0");