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,
"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 "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", "15000000");
INSERT INTO "country" VALUES ("USA", "United States", "331000000", "78.9");
INSERT INTO "country" VALUES ("CAN", "Canada", "38000000", "82.3");
INSERT INTO "country" VALUES ("FRA", "France", "67000000", "82.5");
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 ("MLT", "Malta", "500000", "82.0");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "T");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T");
INSERT INTO "countrylanguage" VALUES ("FRA", "English", "F");
INSERT INTO "countrylanguage" VALUES ("BEL", "French", "T");
INSERT INTO "countrylanguage" VALUES ("BEL", "Dutch", "T");
INSERT INTO "countrylanguage" VALUES ("BEL", "German", "F");
INSERT INTO "countrylanguage" VALUES ("BEL", "English", "T");
INSERT INTO "countrylanguage" VALUES ("SEN", "French", "T");
INSERT INTO "countrylanguage" VALUES ("SEN", "Wolof", "F");
INSERT INTO "countrylanguage" VALUES ("CHE", "German", "T");
INSERT INTO "countrylanguage" VALUES ("CHE", "French", "T");
INSERT INTO "countrylanguage" VALUES ("CHE", "Italian", "F");
INSERT INTO "countrylanguage" VALUES ("CHE", "English", "T");
INSERT INTO "countrylanguage" VALUES ("LUX", "French", "T");
INSERT INTO "countrylanguage" VALUES ("LUX", "German", "T");
INSERT INTO "countrylanguage" VALUES ("LUX", "English", "F");
INSERT INTO "countrylanguage" VALUES ("MLT", "Maltese", "T");
INSERT INTO "countrylanguage" VALUES ("MLT", "English", "T");
INSERT INTO "countrylanguage" VALUES ("MLT", "French", "F");