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,
"LifeExpectancy" FLOAT,
PRIMARY KEY ("Code")
);

CREATE TABLE "countrylanguage" (
"CountryCode" CHAR(3),
"Language" CHAR(30),
"IsOfficial" TEXT,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);





INSERT INTO "country" VALUES ("USA", "United States of America", "331000000", "78.9");
INSERT INTO "country" VALUES ("FRA", "France", "67000000", "82.5");
INSERT INTO "country" VALUES ("CAN", "Canada", "38000000", "82.3");
INSERT INTO "country" VALUES ("BEL", "Belgium", "11500000", "81.2");
INSERT INTO "country" VALUES ("SEN", "Senegal", "16000000", "67.1");
INSERT INTO "country" VALUES ("CHE", "Switzerland", "8600000", "83.8");
INSERT INTO "country" VALUES ("LUX", "Luxembourg", "630000", "82.2");
INSERT INTO "country" VALUES ("MCO", "Monaco", "39000", "89.4");
INSERT INTO "country" VALUES ("CMR", "Cameroon", "27000000", "59.7");
INSERT INTO "country" VALUES ("NGA", "Nigeria", "206000000", "54.3");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T");
INSERT INTO "countrylanguage" VALUES ("USA", "French", "F");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T");
INSERT INTO "countrylanguage" VALUES ("FRA", "English", "F");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "T");
INSERT INTO "countrylanguage" VALUES ("BEL", "French", "T");
INSERT INTO "countrylanguage" VALUES ("BEL", "English", "T");
INSERT INTO "countrylanguage" VALUES ("BEL", "Dutch", "T");
INSERT INTO "countrylanguage" VALUES ("SEN", "French", "T");
INSERT INTO "countrylanguage" VALUES ("SEN", "English", "F");
INSERT INTO "countrylanguage" VALUES ("CHE", "French", "T");
INSERT INTO "countrylanguage" VALUES ("CHE", "German", "T");
INSERT INTO "countrylanguage" VALUES ("CHE", "Italian", "T");
INSERT INTO "countrylanguage" VALUES ("CHE", "English", "F");
INSERT INTO "countrylanguage" VALUES ("LUX", "French", "T");
INSERT INTO "countrylanguage" VALUES ("LUX", "German", "T");
INSERT INTO "countrylanguage" VALUES ("LUX", "English", "T");
INSERT INTO "countrylanguage" VALUES ("MCO", "French", "T");
INSERT INTO "countrylanguage" VALUES ("MCO", "English", "F");
INSERT INTO "countrylanguage" VALUES ("CMR", "French", "T");
INSERT INTO "countrylanguage" VALUES ("CMR", "English", "T");
INSERT INTO "countrylanguage" VALUES ("NGA", "English", "T");
INSERT INTO "countrylanguage" VALUES ("NGA", "French", "F");
INSERT INTO "city" VALUES ("1", "USA");
INSERT INTO "city" VALUES ("2", "FRA");
INSERT INTO "city" VALUES ("3", "CAN");
INSERT INTO "city" VALUES ("4", "BEL");
INSERT INTO "city" VALUES ("5", "SEN");
INSERT INTO "city" VALUES ("6", "CHE");
INSERT INTO "city" VALUES ("7", "LUX");
INSERT INTO "city" VALUES ("8", "MCO");
INSERT INTO "city" VALUES ("9", "CMR");
INSERT INTO "city" VALUES ("10", "NGA");