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),
"IsOfficial" TEXT,
"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 ("CAN", "Canada", "North America");
INSERT INTO "country" VALUES ("MEX", "Mexico", "North America");
INSERT INTO "country" VALUES ("FRA", "France", "Europe");
INSERT INTO "country" VALUES ("GER", "Germany", "Europe");
INSERT INTO "country" VALUES ("ESP", "Spain", "Europe");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America");
INSERT INTO "country" VALUES ("ARG", "Argentina", "South America");
INSERT INTO "country" VALUES ("CHN", "China", "Asia");
INSERT INTO "country" VALUES ("JPN", "Japan", "Asia");
INSERT INTO "country" VALUES ("IND", "India", "Asia");
INSERT INTO "country" VALUES ("RUS", "Russia", "Europe");
INSERT INTO "country" VALUES ("AUS", "Australia", "Oceania");
INSERT INTO "country" VALUES ("NZL", "New Zealand", "Oceania");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "Africa");
INSERT INTO "country" VALUES ("EGY", "Egypt", "Africa");
INSERT INTO "city" VALUES ("1", "USA");
INSERT INTO "city" VALUES ("2", "CAN");
INSERT INTO "city" VALUES ("3", "MEX");
INSERT INTO "city" VALUES ("4", "FRA");
INSERT INTO "city" VALUES ("5", "GER");
INSERT INTO "city" VALUES ("6", "ESP");
INSERT INTO "city" VALUES ("7", "BRA");
INSERT INTO "city" VALUES ("8", "ARG");
INSERT INTO "city" VALUES ("9", "CHN");
INSERT INTO "city" VALUES ("10", "JPN");
INSERT INTO "city" VALUES ("11", "IND");
INSERT INTO "city" VALUES ("12", "RUS");
INSERT INTO "city" VALUES ("13", "AUS");
INSERT INTO "city" VALUES ("14", "NZL");
INSERT INTO "city" VALUES ("15", "ZAF");
INSERT INTO "city" VALUES ("16", "EGY");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "82.1");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T", "58.7");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "T", "22.0");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "T", "92.7");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "88.0");
INSERT INTO "countrylanguage" VALUES ("GER", "German", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T", "74.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish", "T", "90.0");
INSERT INTO "countrylanguage" VALUES ("CHN", "Chinese", "T", "91.0");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese", "T", "99.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "T", "41.0");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "F", "12.0");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian", "T", "96.0");
INSERT INTO "countrylanguage" VALUES ("AUS", "English", "T", "80.0");
INSERT INTO "countrylanguage" VALUES ("NZL", "English", "T", "89.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu", "T", "24.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "F", "9.6");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic", "T", "90.0");
INSERT INTO "countrylanguage" VALUES ("EGY", "English", "F", "5.0");