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", "5000000");
INSERT INTO "city" VALUES ("2", "12000000");
INSERT INTO "city" VALUES ("3", "800000");
INSERT INTO "city" VALUES ("4", "3000000");
INSERT INTO "city" VALUES ("5", "1500000");
INSERT INTO "city" VALUES ("6", "700000");
INSERT INTO "city" VALUES ("7", "4500000");
INSERT INTO "city" VALUES ("8", "2000000");
INSERT INTO "country" VALUES ("USA", "78.9", "republic", "1");
INSERT INTO "country" VALUES ("FRA", "82.3", "republic", "2");
INSERT INTO "country" VALUES ("GER", "81.0", "republic", "3");
INSERT INTO "country" VALUES ("CHN", "76.7", "Communist", "4");
INSERT INTO "country" VALUES ("RUS", "72.4", "republic", "5");
INSERT INTO "country" VALUES ("BRA", "75.5", "republic", "6");
INSERT INTO "country" VALUES ("SAU", "75.0", "Monarchy", "7");
INSERT INTO "country" VALUES ("EGY", "71.8", "republic", "8");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish");
INSERT INTO "countrylanguage" VALUES ("FRA", "French");
INSERT INTO "countrylanguage" VALUES ("GER", "German");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese");
INSERT INTO "countrylanguage" VALUES ("SAU", "Arabic");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic");
INSERT INTO "countrylanguage" VALUES ("EGY", "French");
INSERT INTO "countrylanguage" VALUES ("FRA", "German");