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,
"Population" INT,
PRIMARY KEY ("ID")
);

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"LifeExpectancy" FLOAT,
"GovernmentForm" CHAR(45),
"Capital" 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 "city" VALUES ("1", "500000");
INSERT INTO "city" VALUES ("2", "1200000");
INSERT INTO "city" VALUES ("3", "800000");
INSERT INTO "city" VALUES ("4", "300000");
INSERT INTO "city" VALUES ("5", "450000");
INSERT INTO "city" VALUES ("6", "700000");
INSERT INTO "city" VALUES ("7", "600000");
INSERT INTO "country" VALUES ("USA", "78.9", "Federal Republic", "1");
INSERT INTO "country" VALUES ("FRA", "82.3", "republic", "2");
INSERT INTO "country" VALUES ("GER", "81.0", "Federal Republic", "3");
INSERT INTO "country" VALUES ("ESP", "83.4", "Constitutional Monarchy", "4");
INSERT INTO "country" VALUES ("ITA", "83.0", "republic", "5");
INSERT INTO "country" VALUES ("JPN", "84.5", "Constitutional Monarchy", "6");
INSERT INTO "country" VALUES ("BRA", "75.7", "Federal Republic", "7");
INSERT INTO "country" VALUES ("ARG", "76.3", "republic", "4");
INSERT INTO "country" VALUES ("MEX", "75.0", "Federal Republic", "5");
INSERT INTO "country" VALUES ("CHN", "76.7", "Communist State", "6");
INSERT INTO "country" VALUES ("IND", "69.4", "Federal Republic", "1");
INSERT INTO "country" VALUES ("CAN", "82.0", "Constitutional Monarchy", "2");
INSERT INTO "country" VALUES ("RUS", "72.6", "Federal Republic", "3");
INSERT INTO "country" VALUES ("ZAF", "64.1", "republic", "7");
INSERT INTO "country" VALUES ("EGY", "71.8", "republic", "1");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("FRA", "French");
INSERT INTO "countrylanguage" VALUES ("GER", "German");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish");
INSERT INTO "countrylanguage" VALUES ("ITA", "Italian");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi");
INSERT INTO "countrylanguage" VALUES ("IND", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "French");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic");
INSERT INTO "countrylanguage" VALUES ("EGY", "French");
INSERT INTO "countrylanguage" VALUES ("FRA", "Occitan");
INSERT INTO "countrylanguage" VALUES ("ESP", "Catalan");
INSERT INTO "countrylanguage" VALUES ("ARG", "Guarani");
INSERT INTO "countrylanguage" VALUES ("BRA", "Tupi");
INSERT INTO "countrylanguage" VALUES ("RUS", "Tatar");
INSERT INTO "countrylanguage" VALUES ("IND", "Bengali");
INSERT INTO "countrylanguage" VALUES ("MEX", "Nahuatl");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Xhosa");
INSERT INTO "countrylanguage" VALUES ("EGY", "Coptic");