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

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Continent" TEXT,
"Region" CHAR(26),
PRIMARY KEY ("Code")
);

CREATE TABLE "countrylanguage" (
"CountryCode" CHAR(3),
"Language" CHAR(30),
PRIMARY KEY ("CountryCode", "Language")
);





INSERT INTO "country" VALUES ("AFG", "Asia", "Southern and Central Asia");
INSERT INTO "country" VALUES ("NLD", "Europe", "Western Europe");
INSERT INTO "country" VALUES ("USA", "North America", "North America");
INSERT INTO "country" VALUES ("JPN", "Asia", "Eastern Asia");
INSERT INTO "country" VALUES ("BRA", "South America", "South America");
INSERT INTO "country" VALUES ("CAN", "North America", "North America");
INSERT INTO "country" VALUES ("DEU", "Europe", "Western Europe");
INSERT INTO "country" VALUES ("AUS", "Oceania", "Australia and New Zealand");
INSERT INTO "country" VALUES ("EGY", "Africa", "Northern Africa");
INSERT INTO "country" VALUES ("IND", "Asia", "Southern and Central Asia");
INSERT INTO "city" VALUES ("1", "Kabul", "AFG", "1780000");
INSERT INTO "city" VALUES ("2", "Amsterdam", "NLD", "731200");
INSERT INTO "city" VALUES ("3", "New York", "USA", "8008278");
INSERT INTO "city" VALUES ("4", "Tokyo", "JPN", "7980230");
INSERT INTO "city" VALUES ("5", "Rio de Janeiro", "BRA", "6023699");
INSERT INTO "city" VALUES ("6", "Toronto", "CAN", "2481494");
INSERT INTO "city" VALUES ("7", "Berlin", "DEU", "3386667");
INSERT INTO "city" VALUES ("8", "Sydney", "AUS", "3276207");
INSERT INTO "city" VALUES ("9", "Cairo", "EGY", "6789479");
INSERT INTO "city" VALUES ("10", "Mumbai", "IND", "11978450");
INSERT INTO "city" VALUES ("11", "Herat", "AFG", "349000");
INSERT INTO "city" VALUES ("12", "Kandahar", "AFG", "491000");
INSERT INTO "countrylanguage" VALUES ("AFG", "Dari");
INSERT INTO "countrylanguage" VALUES ("AFG", "Pashto");
INSERT INTO "countrylanguage" VALUES ("NLD", "Dutch");
INSERT INTO "countrylanguage" VALUES ("USA", "English");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese");
INSERT INTO "countrylanguage" VALUES ("CAN", "English");
INSERT INTO "countrylanguage" VALUES ("CAN", "French");
INSERT INTO "countrylanguage" VALUES ("DEU", "German");
INSERT INTO "countrylanguage" VALUES ("AUS", "English");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi");
INSERT INTO "countrylanguage" VALUES ("IND", "English");