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,
"Name" CHAR(35),
"Population" INT,
PRIMARY KEY ("ID")
);

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Population" INT,
PRIMARY KEY ("Code")
);

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





INSERT INTO "city" VALUES ("1", "Springfield", "150000");
INSERT INTO "city" VALUES ("2", "Rivertown", "160000");
INSERT INTO "city" VALUES ("3", "Lakeside", "450000");
INSERT INTO "city" VALUES ("4", "Hillview", "900000");
INSERT INTO "city" VALUES ("5", "Oceanport", "900001");
INSERT INTO "city" VALUES ("6", "Mapleton", "159999");
INSERT INTO "city" VALUES ("7", "Greendale", "300000");
INSERT INTO "city" VALUES ("8", "Sunnyvale", "850000");
INSERT INTO "city" VALUES ("9", "Brookfield", "1000000");
INSERT INTO "city" VALUES ("10", "Fairview", "200000");
INSERT INTO "country" VALUES ("USA", "331000000");
INSERT INTO "country" VALUES ("CAN", "38000000");
INSERT INTO "country" VALUES ("MEX", "128000000");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish");
INSERT INTO "countrylanguage" VALUES ("CAN", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "French");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish");
INSERT INTO "countrylanguage" VALUES ("MEX", "Nahuatl");