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





INSERT INTO "city" VALUES ("1", "Madrid");
INSERT INTO "city" VALUES ("2", "Mexico City");
INSERT INTO "city" VALUES ("3", "Buenos Aires");
INSERT INTO "city" VALUES ("4", "Bogota");
INSERT INTO "city" VALUES ("5", "Lima");
INSERT INTO "city" VALUES ("6", "Santiago");
INSERT INTO "city" VALUES ("7", "Caracas");
INSERT INTO "city" VALUES ("8", "Barcelona");
INSERT INTO "city" VALUES ("9", "Seville");
INSERT INTO "city" VALUES ("10", "Guadalajara");
INSERT INTO "country" VALUES ("ESP", "Spain", "47000000");
INSERT INTO "country" VALUES ("MEX", "Mexico", "128000000");
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 ("VEN", "Venezuela", "28000000");
INSERT INTO "country" VALUES ("USA", "United States", "330000000");
INSERT INTO "country" VALUES ("CAN", "Canada", "38000000");
INSERT INTO "country" VALUES ("BRA", "Brazil", "215000000");
INSERT INTO "country" VALUES ("PRT", "Portugal", "10000000");
INSERT INTO "country" VALUES ("FRA", "France", "65000000");
INSERT INTO "country" VALUES ("DEU", "Germany", "83000000");
INSERT INTO "country" VALUES ("ITA", "Italy", "59000000");
INSERT INTO "country" VALUES ("GBR", "United Kingdom", "67000000");
INSERT INTO "countrylanguage" VALUES ("ESP", "Spanish", "99.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Catalan", "17.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "Basque", "2.0");
INSERT INTO "countrylanguage" VALUES ("MEX", "Spanish", "98.0");
INSERT INTO "countrylanguage" VALUES ("MEX", "Nahuatl", "1.5");
INSERT INTO "countrylanguage" VALUES ("ARG", "Spanish", "98.5");
INSERT INTO "countrylanguage" VALUES ("ARG", "Italian", "1.0");
INSERT INTO "countrylanguage" VALUES ("COL", "Spanish", "99.0");
INSERT INTO "countrylanguage" VALUES ("PER", "Spanish", "84.0");
INSERT INTO "countrylanguage" VALUES ("PER", "Quechua", "13.0");
INSERT INTO "countrylanguage" VALUES ("CHL", "Spanish", "99.0");
INSERT INTO "countrylanguage" VALUES ("VEN", "Spanish", "98.0");
INSERT INTO "countrylanguage" VALUES ("USA", "English", "82.0");
INSERT INTO "countrylanguage" VALUES ("USA", "Spanish", "13.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "English", "58.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "French", "22.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Portuguese", "97.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "Spanish", "0.5");
INSERT INTO "countrylanguage" VALUES ("PRT", "Portuguese", "99.0");
INSERT INTO "countrylanguage" VALUES ("FRA", "French", "98.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "German", "95.0");
INSERT INTO "countrylanguage" VALUES ("ITA", "Italian", "95.0");
INSERT INTO "countrylanguage" VALUES ("GBR", "English", "98.0");
INSERT INTO "countrylanguage" VALUES ("ESP", "English", "10.0");
INSERT INTO "countrylanguage" VALUES ("MEX", "English", "5.0");
INSERT INTO "countrylanguage" VALUES ("ARG", "English", "3.0");
INSERT INTO "countrylanguage" VALUES ("COL", "English", "2.0");
INSERT INTO "countrylanguage" VALUES ("PER", "English", "1.0");
INSERT INTO "countrylanguage" VALUES ("CHL", "English", "5.0");
INSERT INTO "countrylanguage" VALUES ("VEN", "English", "1.0");
INSERT INTO "countrylanguage" VALUES ("USA", "Chinese", "1.0");
INSERT INTO "countrylanguage" VALUES ("CAN", "Chinese", "1.0");
INSERT INTO "countrylanguage" VALUES ("BRA", "German", "0.5");
INSERT INTO "countrylanguage" VALUES ("PRT", "Spanish", "0.1");
INSERT INTO "countrylanguage" VALUES ("FRA", "Arabic", "1.0");
INSERT INTO "countrylanguage" VALUES ("DEU", "Turkish", "1.0");
INSERT INTO "countrylanguage" VALUES ("ITA", "Albanian", "0.5");
INSERT INTO "countrylanguage" VALUES ("GBR", "Polish", "1.0");