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,
"Population" INT,
"GovernmentForm" CHAR(45),
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", "331000000", "Federal Republic");
INSERT INTO "country" VALUES ("GBR", "67000000", "Constitutional Monarchy");
INSERT INTO "country" VALUES ("FRA", "67000000", "Republic");
INSERT INTO "country" VALUES ("CHN", "1400000000", "Communist State");
INSERT INTO "country" VALUES ("JPN", "126000000", "Constitutional Monarchy");
INSERT INTO "country" VALUES ("EGY", "102000000", "Republic");
INSERT INTO "country" VALUES ("SAU", "35000000", "Absolute Monarchy");
INSERT INTO "country" VALUES ("IND", "1380000000", "Federal Republic");
INSERT INTO "country" VALUES ("RUS", "146000000", "Federal Republic");
INSERT INTO "country" VALUES ("CAN", "38000000", "Constitutional Monarchy");
INSERT INTO "city" VALUES ("1", "USA", "8800000");
INSERT INTO "city" VALUES ("2", "GBR", "8900000");
INSERT INTO "city" VALUES ("3", "FRA", "2140000");
INSERT INTO "city" VALUES ("4", "CHN", "21500000");
INSERT INTO "city" VALUES ("5", "JPN", "13900000");
INSERT INTO "city" VALUES ("6", "EGY", "9500000");
INSERT INTO "city" VALUES ("7", "SAU", "7000000");
INSERT INTO "city" VALUES ("8", "IND", "12000000");
INSERT INTO "city" VALUES ("9", "RUS", "12000000");
INSERT INTO "city" VALUES ("10", "CAN", "2700000");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("GBR", "English");
INSERT INTO "countrylanguage" VALUES ("FRA", "French");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic");
INSERT INTO "countrylanguage" VALUES ("SAU", "Arabic");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi");
INSERT INTO "countrylanguage" VALUES ("IND", "English");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian");
INSERT INTO "countrylanguage" VALUES ("CAN", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "French");