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),
"Population" INT,
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),
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 ("CAN", "Canada", "38000000");
INSERT INTO "country" VALUES ("BEL", "Belgium", "11500000");
INSERT INTO "country" VALUES ("SUI", "Switzerland", "8600000");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "60000000");
INSERT INTO "country" VALUES ("ESP", "Spain", "47000000");
INSERT INTO "country" VALUES ("MEX", "Mexico", "128000000");
INSERT INTO "city" VALUES ("1", "USA", "8800000");
INSERT INTO "city" VALUES ("2", "USA", "4300000");
INSERT INTO "city" VALUES ("3", "IND", "21000000");
INSERT INTO "city" VALUES ("4", "IND", "12000000");
INSERT INTO "city" VALUES ("5", "CAN", "2700000");
INSERT INTO "city" VALUES ("6", "CAN", "1400000");
INSERT INTO "city" VALUES ("7", "BEL", "1200000");
INSERT INTO "city" VALUES ("8", "SUI", "400000");
INSERT INTO "city" VALUES ("9", "ZAF", "3500000");
INSERT INTO "city" VALUES ("10", "ESP", "3200000");
INSERT INTO "city" VALUES ("11", "MEX", "9000000");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish");
INSERT INTO "countrylanguage" VALUES ("USA", "Chinese");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi");
INSERT INTO "countrylanguage" VALUES ("IND", "English");
INSERT INTO "countrylanguage" VALUES ("IND", "Bengali");
INSERT INTO "countrylanguage" VALUES ("IND", "Telugu");
INSERT INTO "countrylanguage" VALUES ("CAN", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "French");
INSERT INTO "countrylanguage" VALUES ("BEL", "Dutch");
INSERT INTO "countrylanguage" VALUES ("BEL", "French");
INSERT INTO "countrylanguage" VALUES ("BEL", "German");
INSERT INTO "countrylanguage" VALUES ("SUI", "German");
INSERT INTO "countrylanguage" VALUES ("SUI", "French");
INSERT INTO "countrylanguage" VALUES ("SUI", "Italian");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Xhosa");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Afrikaans");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish");
INSERT INTO "countrylanguage" VALUES ("MEX", "Nahuatl");