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,
"Percentage" FLOAT,
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 "city" VALUES ("6", "4500000");
INSERT INTO "city" VALUES ("7", "700000");
INSERT INTO "city" VALUES ("8", "2000000");
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.5");
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 "countrylanguage" VALUES ("USA", "English", "T", "82.1");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F", "13.5");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "100.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "English", "F", "39.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T", "56.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "T", "21.0");
INSERT INTO "countrylanguage" VALUES ("BEL", "French", "T", "40.0");
INSERT INTO "countrylanguage" VALUES ("BEL", "Dutch", "T", "60.0");
INSERT INTO "countrylanguage" VALUES ("BEL", "English", "F", "10.0");
INSERT INTO "countrylanguage" VALUES ("SEN", "French", "T", "100.0");
INSERT INTO "countrylanguage" VALUES ("SEN", "Wolof", "F", "80.0");
INSERT INTO "countrylanguage" VALUES ("CHE", "German", "T", "63.0");
INSERT INTO "countrylanguage" VALUES ("CHE", "French", "T", "23.0");
INSERT INTO "countrylanguage" VALUES ("CHE", "Italian", "T", "8.0");
INSERT INTO "countrylanguage" VALUES ("CHE", "English", "F", "5.0");
INSERT INTO "countrylanguage" VALUES ("LUX", "French", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("LUX", "German", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("LUX", "English", "F", "20.0");
INSERT INTO "countrylanguage" VALUES ("MCO", "French", "T", "100.0");
INSERT INTO "countrylanguage" VALUES ("MCO", "English", "F", "15.0");