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

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),
"Percentage" FLOAT,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY ("CountryCode") REFERENCES "country"("Code")
);





INSERT INTO "country" VALUES ("ABW", "Aruba", "110000", "78.5");
INSERT INTO "country" VALUES ("USA", "United States", "331000000", "79.1");
INSERT INTO "country" VALUES ("NLD", "Netherlands", "17400000", "81.5");
INSERT INTO "country" VALUES ("ESP", "Spain", "47000000", "83.4");
INSERT INTO "country" VALUES ("FRA", "France", "67000000", "82.3");
INSERT INTO "city" VALUES ("1", "ABW");
INSERT INTO "city" VALUES ("2", "ABW");
INSERT INTO "city" VALUES ("3", "USA");
INSERT INTO "city" VALUES ("4", "NLD");
INSERT INTO "city" VALUES ("5", "ESP");
INSERT INTO "countrylanguage" VALUES ("ABW", "Dutch", "57.0");
INSERT INTO "countrylanguage" VALUES ("ABW", "Papiamento", "70.0");
INSERT INTO "countrylanguage" VALUES ("ABW", "English", "30.0");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "80.0");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "13.0");
INSERT INTO "countrylanguage" VALUES ("NLD", "Dutch", "95.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "99.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "88.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "English", "15.0");