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),
"Continent" TEXT,
"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", "North America", "331000000");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "Europe", "67000000");
INSERT INTO "country" VALUES ("CAN", "Canada", "North America", "38000000");
INSERT INTO "country" VALUES ("AUS", "Australia", "Oceania", "25000000");
INSERT INTO "country" VALUES ("IND", "India", "Asia", "1380000000");
INSERT INTO "country" VALUES ("CHN", "China", "Asia", "1440000000");
INSERT INTO "country" VALUES ("DEU", "Germany", "Europe", "83000000");
INSERT INTO "country" VALUES ("FRA", "France", "Europe", "65000000");
INSERT INTO "country" VALUES ("JPN", "Japan", "Asia", "126000000");
INSERT INTO "country" VALUES ("BRA", "Brazil", "South America", "212000000");
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", "Beijing", "CHN", "21000000");
INSERT INTO "city" VALUES ("7", "Berlin", "DEU", "3700000");
INSERT INTO "city" VALUES ("8", "Paris", "FRA", "2100000");
INSERT INTO "city" VALUES ("9", "Tokyo", "JPN", "14000000");
INSERT INTO "city" VALUES ("10", "Sao Paulo", "BRA", "12000000");
INSERT INTO "city" VALUES ("11", "Los Angeles", "USA", "3900000");
INSERT INTO "city" VALUES ("12", "Chicago", "USA", "2700000");
INSERT INTO "city" VALUES ("13", "Manchester", "GBR", "550000");
INSERT INTO "city" VALUES ("14", "Vancouver", "CAN", "670000");
INSERT INTO "city" VALUES ("15", "Melbourne", "AUS", "5000000");
INSERT INTO "city" VALUES ("16", "Delhi", "IND", "19000000");
INSERT INTO "city" VALUES ("17", "Shanghai", "CHN", "26000000");
INSERT INTO "city" VALUES ("18", "Munich", "DEU", "1500000");
INSERT INTO "city" VALUES ("19", "Marseille", "FRA", "870000");
INSERT INTO "city" VALUES ("20", "Osaka", "JPN", "2700000");
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 ("CHN", "Mandarin", "T");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "T");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T");
INSERT INTO "countrylanguage" VALUES ("JPN", "Japanese", "T");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "T");
INSERT INTO "countrylanguage" VALUES ("USA", "French", "F");
INSERT INTO "countrylanguage" VALUES ("GBR", "Welsh", "F");
INSERT INTO "countrylanguage" VALUES ("AUS", "Aboriginal languages", "F");
INSERT INTO "countrylanguage" VALUES ("IND", "Bengali", "F");
INSERT INTO "countrylanguage" VALUES ("CHN", "Cantonese", "F");
INSERT INTO "countrylanguage" VALUES ("DEU", "Turkish", "F");
INSERT INTO "countrylanguage" VALUES ("FRA", "Arabic", "F");