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,
"Name" CHAR(52),
"Continent" TEXT,
"Population" INT,
PRIMARY KEY ("Code")
);





INSERT INTO "country" VALUES ("AIA", "Anguilla", "North America", "15000");
INSERT INTO "country" VALUES ("USA", "United States", "North America", "331000000");
INSERT INTO "country" VALUES ("FRA", "France", "Europe", "67000000");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America", "211000000");
INSERT INTO "country" VALUES ("AUS", "Australia", "Oceania", "25000000");
INSERT INTO "country" VALUES ("EGY", "Egypt", "Africa", "100000000");
INSERT INTO "country" VALUES ("CHN", "China", "Asia", "1400000000");
INSERT INTO "country" VALUES ("GRL", "Greenland", "North America", "56000");
INSERT INTO "country" VALUES ("ATA", "Antarctica", "Antarctica", "0");
INSERT INTO "city" VALUES ("1", "AIA", "15000");
INSERT INTO "city" VALUES ("2", "USA", "8800000");
INSERT INTO "city" VALUES ("3", "USA", "4000000");
INSERT INTO "city" VALUES ("4", "FRA", "2100000");
INSERT INTO "city" VALUES ("5", "BRA", "12000000");
INSERT INTO "city" VALUES ("6", "AUS", "5000000");
INSERT INTO "city" VALUES ("7", "EGY", "9000000");
INSERT INTO "city" VALUES ("8", "CHN", "24000000");
INSERT INTO "city" VALUES ("9", "GRL", "56000");
INSERT INTO "city" VALUES ("10", "AIA", "5000");