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),
"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 ("USA", "United States of America", "331000000");
INSERT INTO "country" VALUES ("IND", "India", "1380004385");
INSERT INTO "country" VALUES ("BRA", "Brazil", "212600000");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "59300000");
INSERT INTO "country" VALUES ("CHE", "Switzerland", "8600000");
INSERT INTO "country" VALUES ("BEL", "Belgium", "11500000");
INSERT INTO "country" VALUES ("CAN", "Canada", "37590000");
INSERT INTO "country" VALUES ("MYS", "Malaysia", "32000000");
INSERT INTO "country" VALUES ("SGP", "Singapore", "5700000");
INSERT INTO "country" VALUES ("RUS", "Russia", "146000000");
INSERT INTO "city" VALUES ("1", "USA");
INSERT INTO "city" VALUES ("2", "IND");
INSERT INTO "city" VALUES ("3", "BRA");
INSERT INTO "city" VALUES ("4", "ZAF");
INSERT INTO "city" VALUES ("5", "CHE");
INSERT INTO "city" VALUES ("6", "BEL");
INSERT INTO "city" VALUES ("7", "CAN");
INSERT INTO "city" VALUES ("8", "MYS");
INSERT INTO "city" VALUES ("9", "SGP");
INSERT INTO "city" VALUES ("10", "RUS");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "82.1");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "13.5");
INSERT INTO "countrylanguage" VALUES ("USA", "Chinese", "1.1");
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 ("IND", "Marathi", "7.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Tamil", "6.0");
INSERT INTO "countrylanguage" VALUES ("IND", "Urdu", "5.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "98.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Spanish", "1.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu", "22.7");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Xhosa", "16.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Afrikaans", "13.5");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "9.6");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Sepedi", "9.1");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Setswana", "8.0");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Sesotho", "7.6");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Xitsonga", "4.5");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Swati", "2.5");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Tshivenda", "2.4");
INSERT INTO "countrylanguage" VALUES ("ZAF", "IsiNdebele", "2.1");
INSERT INTO "countrylanguage" VALUES ("CHE", "German", "62.0");
INSERT INTO "countrylanguage" VALUES ("CHE", "French", "23.0");
INSERT INTO "countrylanguage" VALUES ("CHE", "Italian", "8.0");
INSERT INTO "countrylanguage" VALUES ("CHE", "Romansh", "0.5");
INSERT INTO "countrylanguage" VALUES ("BEL", "Dutch", "60.0");
INSERT INTO "countrylanguage" VALUES ("BEL", "French", "40.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "56.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "21.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Malay", "50.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Chinese", "23.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "Tamil", "7.0");
INSERT INTO "countrylanguage" VALUES ("MYS", "English", "10.0");
INSERT INTO "countrylanguage" VALUES ("SGP", "English", "36.9");
INSERT INTO "countrylanguage" VALUES ("SGP", "Mandarin", "35.8");
INSERT INTO "countrylanguage" VALUES ("SGP", "Malay", "13.4");
INSERT INTO "countrylanguage" VALUES ("SGP", "Tamil", "3.3");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian", "85.0");
INSERT INTO "countrylanguage" VALUES ("RUS", "Tatar", "3.0");
INSERT INTO "countrylanguage" VALUES ("RUS", "Ukrainian", "2.0");
INSERT INTO "countrylanguage" VALUES ("RUS", "Bashkir", "1.2");
INSERT INTO "countrylanguage" VALUES ("RUS", "Chuvash", "1.0");