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),
PRIMARY KEY ("ID")
);

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





INSERT INTO "city" VALUES ("1", "New York");
INSERT INTO "city" VALUES ("2", "Los Angeles");
INSERT INTO "city" VALUES ("3", "Chicago");
INSERT INTO "city" VALUES ("4", "Houston");
INSERT INTO "city" VALUES ("5", "Phoenix");
INSERT INTO "city" VALUES ("6", "Madrid");
INSERT INTO "city" VALUES ("7", "Mexico City");
INSERT INTO "city" VALUES ("8", "Buenos Aires");
INSERT INTO "city" VALUES ("9", "Bogota");
INSERT INTO "city" VALUES ("10", "Lima");
INSERT INTO "country" VALUES ("USA", "United States", "331000000");
INSERT INTO "country" VALUES ("CAN", "Canada", "38000000");
INSERT INTO "country" VALUES ("MEX", "Mexico", "128000000");
INSERT INTO "country" VALUES ("ESP", "Spain", "47000000");
INSERT INTO "country" VALUES ("ARG", "Argentina", "45000000");
INSERT INTO "country" VALUES ("COL", "Colombia", "51000000");
INSERT INTO "country" VALUES ("PER", "Peru", "33000000");
INSERT INTO "country" VALUES ("CHL", "Chile", "19000000");
INSERT INTO "country" VALUES ("BRA", "Brazil", "213000000");
INSERT INTO "country" VALUES ("DEU", "Germany", "83000000");
INSERT INTO "country" VALUES ("FRA", "France", "65000000");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "67000000");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "T", "80.0");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "F", "13.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "T", "58.7");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "T", "22.0");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "T", "95.0");
INSERT INTO "countrylanguage" VALUES ("MEX", "Nahuatl", "F", "1.5");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "T", "99.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Catalan", "F", "17.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "Italian", "F", "1.5");
INSERT INTO "countrylanguage" VALUES ("COL", "Spanish", "T", "99.2");
INSERT INTO "countrylanguage" VALUES ("COL", "Wayuu", "F", "0.5");
INSERT INTO "countrylanguage" VALUES ("PER", "Spanish", "T", "84.1");
INSERT INTO "countrylanguage" VALUES ("PER", "Quechua", "F", "13.0");
INSERT INTO "countrylanguage" VALUES ("CHL", "Spanish", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("CHL", "Mapudungun", "F", "1.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "T", "97.5");
INSERT INTO "countrylanguage" VALUES ("BRA", "Spanish", "F", "0.5");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "T", "91.5");
INSERT INTO "countrylanguage" VALUES ("DEU", "Turkish", "F", "2.5");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "T", "93.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "Arabic", "F", "2.0");
INSERT INTO "countrylanguage" VALUES ("GBR", "English", "T", "98.0");
INSERT INTO "countrylanguage" VALUES ("GBR", "Welsh", "F", "1.0");