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),
"Population" INT,
PRIMARY KEY ("ID"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Region" CHAR(26),
"SurfaceArea" FLOAT,
PRIMARY KEY ("Code")
);

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





INSERT INTO "country" VALUES ("CUB", "Caribbean", "109884.0");
INSERT INTO "country" VALUES ("JAM", "Caribbean", "10991.0");
INSERT INTO "country" VALUES ("HTI", "Caribbean", "27750.0");
INSERT INTO "country" VALUES ("BRB", "Caribbean", "430.0");
INSERT INTO "country" VALUES ("TTO", "Caribbean", "5130.0");
INSERT INTO "country" VALUES ("USA", "North America", "9833520.0");
INSERT INTO "country" VALUES ("MEX", "North America", "1964375.0");
INSERT INTO "country" VALUES ("CAN", "North America", "9984670.0");
INSERT INTO "city" VALUES ("1", "CUB", "2100000");
INSERT INTO "city" VALUES ("2", "CUB", "800000");
INSERT INTO "city" VALUES ("3", "JAM", "600000");
INSERT INTO "city" VALUES ("4", "HTI", "1000000");
INSERT INTO "city" VALUES ("5", "BRB", "110000");
INSERT INTO "city" VALUES ("6", "TTO", "490000");
INSERT INTO "city" VALUES ("7", "USA", "8400000");
INSERT INTO "city" VALUES ("8", "MEX", "9000000");
INSERT INTO "city" VALUES ("9", "CAN", "2700000");
INSERT INTO "countrylanguage" VALUES ("CUB", "Spanish");
INSERT INTO "countrylanguage" VALUES ("JAM", "English");
INSERT INTO "countrylanguage" VALUES ("HTI", "French");
INSERT INTO "countrylanguage" VALUES ("HTI", "Haitian Creole");
INSERT INTO "countrylanguage" VALUES ("BRB", "English");
INSERT INTO "countrylanguage" VALUES ("TTO", "English");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish");
INSERT INTO "countrylanguage" VALUES ("CAN", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "French");