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

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





INSERT INTO "country" VALUES ("USA", "United States", "331000000");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "67000000");
INSERT INTO "country" VALUES ("CAN", "Canada", "38000000");
INSERT INTO "country" VALUES ("AUS", "Australia", "25000000");
INSERT INTO "country" VALUES ("IND", "India", "1380000000");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "59000000");
INSERT INTO "country" VALUES ("IRL", "Ireland", "5000000");
INSERT INTO "country" VALUES ("NZL", "New Zealand", "5000000");
INSERT INTO "country" VALUES ("DEU", "Germany", "83000000");
INSERT INTO "country" VALUES ("FRA", "France", "65000000");
INSERT INTO "city" VALUES ("1", "New York", "USA", "8400000");
INSERT INTO "city" VALUES ("2", "London", "GBR", "8900000");
INSERT INTO "city" VALUES ("3", "Toronto", "CAN", "2900000");
INSERT INTO "city" VALUES ("4", "Sydney", "AUS", "5300000");
INSERT INTO "city" VALUES ("5", "Mumbai", "IND", "20000000");
INSERT INTO "city" VALUES ("6", "Johannesburg", "ZAF", "5700000");
INSERT INTO "city" VALUES ("7", "Dublin", "IRL", "1200000");
INSERT INTO "city" VALUES ("8", "Auckland", "NZL", "1600000");
INSERT INTO "city" VALUES ("9", "Los Angeles", "USA", "3900000");
INSERT INTO "city" VALUES ("10", "Chicago", "USA", "2700000");
INSERT INTO "city" VALUES ("11", "Melbourne", "AUS", "5000000");
INSERT INTO "city" VALUES ("12", "Delhi", "IND", "19000000");
INSERT INTO "city" VALUES ("13", "Cape Town", "ZAF", "4600000");
INSERT INTO "city" VALUES ("14", "Manchester", "GBR", "550000");
INSERT INTO "city" VALUES ("15", "Vancouver", "CAN", "670000");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F");
INSERT INTO "countrylanguage" VALUES ("GBR", "English", "T");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "T");
INSERT INTO "countrylanguage" VALUES ("AUS", "English", "T");
INSERT INTO "countrylanguage" VALUES ("IND", "Hindi", "T");
INSERT INTO "countrylanguage" VALUES ("IND", "English", "F");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu", "T");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "T");
INSERT INTO "countrylanguage" VALUES ("IRL", "Irish", "T");
INSERT INTO "countrylanguage" VALUES ("IRL", "English", "T");
INSERT INTO "countrylanguage" VALUES ("NZL", "Maori", "T");
INSERT INTO "countrylanguage" VALUES ("NZL", "English", "T");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "T");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T");
INSERT INTO "countrylanguage" VALUES ("USA", "Chinese", "F");
INSERT INTO "countrylanguage" VALUES ("GBR", "Welsh", "F");
INSERT INTO "countrylanguage" VALUES ("AUS", "Mandarin", "F");
INSERT INTO "countrylanguage" VALUES ("IND", "Bengali", "F");