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

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





INSERT INTO "country" VALUES ("AFG", "Afghanistan", "Southern and Central Asia", "38928341");
INSERT INTO "country" VALUES ("PAK", "Pakistan", "Southern and Central Asia", "220892331");
INSERT INTO "country" VALUES ("IND", "India", "Southern and Central Asia", "1380004385");
INSERT INTO "country" VALUES ("USA", "United States", "North America", "331002651");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America", "37742154");
INSERT INTO "country" VALUES ("CHN", "China", "Eastern Asia", "1439323776");
INSERT INTO "country" VALUES ("RUS", "Russia", "Eastern Europe", "145934462");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America", "212559417");
INSERT INTO "country" VALUES ("AUS", "Australia", "Oceania", "25499884");
INSERT INTO "country" VALUES ("EGY", "Egypt", "Northern Africa", "102334404");
INSERT INTO "city" VALUES ("1", "Kabul", "AFG", "Kabol");
INSERT INTO "city" VALUES ("2", "Karachi", "PAK", "Sindh");
INSERT INTO "city" VALUES ("3", "Mumbai", "IND", "Maharashtra");
INSERT INTO "city" VALUES ("4", "New York", "USA", "New York");
INSERT INTO "city" VALUES ("5", "Toronto", "CAN", "Ontario");
INSERT INTO "city" VALUES ("6", "Beijing", "CHN", "Beijing");
INSERT INTO "city" VALUES ("7", "Moscow", "RUS", "Moscow");
INSERT INTO "city" VALUES ("8", "Rio de Janeiro", "BRA", "Rio de Janeiro");
INSERT INTO "city" VALUES ("9", "Sydney", "AUS", "New South Wales");
INSERT INTO "city" VALUES ("10", "Cairo", "EGY", "Cairo");
INSERT INTO "city" VALUES ("11", "Herat", "AFG", "Herat");
INSERT INTO "city" VALUES ("12", "Lahore", "PAK", "Punjab");
INSERT INTO "city" VALUES ("13", "Delhi", "IND", "Delhi");
INSERT INTO "city" VALUES ("14", "Los Angeles", "USA", "California");
INSERT INTO "city" VALUES ("15", "Vancouver", "CAN", "British Columbia");