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),
"Continent" TEXT,
"Population" INT,
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 "country" VALUES ("ABW", "Aruba", "North America", "106766");
INSERT INTO "country" VALUES ("USA", "United States", "North America", "331000000");
INSERT INTO "country" VALUES ("NLD", "Netherlands", "Europe", "17400000");
INSERT INTO "country" VALUES ("ESP", "Spain", "Europe", "47000000");
INSERT INTO "country" VALUES ("FRA", "France", "Europe", "67000000");
INSERT INTO "city" VALUES ("1", "105000");
INSERT INTO "city" VALUES ("2", "8000000");
INSERT INTO "city" VALUES ("3", "8500000");
INSERT INTO "city" VALUES ("4", "3200000");
INSERT INTO "city" VALUES ("5", "2200000");
INSERT INTO "countrylanguage" VALUES ("ABW", "Dutch", "T", "57.0");
INSERT INTO "countrylanguage" VALUES ("ABW", "Papiamento", "T", "70.0");
INSERT INTO "countrylanguage" VALUES ("ABW", "English", "F", "30.0");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "82.1");
INSERT INTO "countrylanguage" VALUES ("NLD", "Dutch", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T", "99.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "100.0");