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

CREATE TABLE "country" (
"Code" CHAR(3) UNIQUE,
"Name" CHAR(52),
"IndepYear" INT,
"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 of America", "1776", "331000000");
INSERT INTO "country" VALUES ("FRA", "France", "1792", "67000000");
INSERT INTO "country" VALUES ("GER", "Germany", "1871", "83000000");
INSERT INTO "country" VALUES ("ITA", "Italy", "1861", "60000000");
INSERT INTO "country" VALUES ("BRA", "Brazil", "1822", "211000000");
INSERT INTO "country" VALUES ("CAN", "Canada", "1867", "38000000");
INSERT INTO "country" VALUES ("AUS", "Australia", "1901", "25000000");
INSERT INTO "country" VALUES ("IND", "India", "1947", "1380000000");
INSERT INTO "country" VALUES ("JPN", "Japan", "660", "126000000");
INSERT INTO "country" VALUES ("MEX", "Mexico", "1810", "128000000");
INSERT INTO "country" VALUES ("RUS", "Russia", "1991", "146000000");
INSERT INTO "country" VALUES ("CHN", "China", "1949", "1400000000");
INSERT INTO "country" VALUES ("EGY", "Egypt", "1922", "102000000");
INSERT INTO "country" VALUES ("ZAF", "South Africa", "1910", "59000000");
INSERT INTO "country" VALUES ("ESP", "Spain", "1492", "47000000");
INSERT INTO "city" VALUES ("1", "USA");
INSERT INTO "city" VALUES ("2", "FRA");
INSERT INTO "city" VALUES ("3", "GER");
INSERT INTO "city" VALUES ("4", "ITA");
INSERT INTO "city" VALUES ("5", "BRA");
INSERT INTO "city" VALUES ("6", "CAN");
INSERT INTO "city" VALUES ("7", "AUS");
INSERT INTO "city" VALUES ("8", "IND");
INSERT INTO "city" VALUES ("9", "JPN");
INSERT INTO "city" VALUES ("10", "MEX");
INSERT INTO "city" VALUES ("11", "RUS");
INSERT INTO "city" VALUES ("12", "CHN");
INSERT INTO "city" VALUES ("13", "EGY");
INSERT INTO "city" VALUES ("14", "ZAF");
INSERT INTO "city" VALUES ("15", "ESP");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T");
INSERT INTO "countrylanguage" VALUES ("GER", "German", "T");
INSERT INTO "countrylanguage" VALUES ("GER", "English", "F");
INSERT INTO "countrylanguage" VALUES ("ITA", "Italian", "T");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "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 ("JPN", "Japanese", "T");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "T");
INSERT INTO "countrylanguage" VALUES ("RUS", "Russian", "T");
INSERT INTO "countrylanguage" VALUES ("CHN", "Mandarin", "T");
INSERT INTO "countrylanguage" VALUES ("EGY", "Arabic", "T");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Zulu", "F");
INSERT INTO "countrylanguage" VALUES ("ZAF", "Afrikaans", "T");
INSERT INTO "countrylanguage" VALUES ("ZAF", "English", "T");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T");
INSERT INTO "countrylanguage" VALUES ("ESP", "Catalan", "F");