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,
"Population" INT,
"HeadOfState" CHAR(60),
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 ("NLD", "17000000", "Beatrix");
INSERT INTO "country" VALUES ("USA", "330000000", "Joe Biden");
INSERT INTO "country" VALUES ("FRA", "67000000", "Emmanuel Macron");
INSERT INTO "country" VALUES ("ESP", "47000000", "Felipe VI");
INSERT INTO "country" VALUES ("BEL", "11500000", "Philippe");
INSERT INTO "city" VALUES ("1", "NLD", "872757");
INSERT INTO "city" VALUES ("2", "NLD", "2170000");
INSERT INTO "city" VALUES ("3", "USA", "8800000");
INSERT INTO "city" VALUES ("4", "FRA", "2148000");
INSERT INTO "city" VALUES ("5", "ESP", "3223000");
INSERT INTO "city" VALUES ("6", "BEL", "1200000");
INSERT INTO "countrylanguage" VALUES ("NLD", "Dutch", "T");
INSERT INTO "countrylanguage" VALUES ("NLD", "Frisian", "F");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T");
INSERT INTO "countrylanguage" VALUES ("BEL", "Dutch", "T");
INSERT INTO "countrylanguage" VALUES ("BEL", "French", "T");
INSERT INTO "countrylanguage" VALUES ("BEL", "German", "F");